1## Print function for ssanova objects 2print.ssanova <- function(x,...) 3{ 4 ## call 5 cat("\nCall:\n",deparse(x$call),"\n\n",sep="") 6 ## terms 7 cat("Terms:\n") 8 print.default(c(x$terms$labels,x$lab.p)) 9 cat("\n") 10 ## terms overview 11 cat("Number of unpenalized and penalized terms:\n\n") 12 print.default(x$desc) 13 cat("\n") 14 if (x$method=="v") Method <- "GCV " 15 if (x$method=="m") Method <- "GML.\n" 16 if (x$method=="u") Method <- "Mallows CL " 17 if (x$method=="m") cat("Smoothing parameters are selected by",Method) 18 else cat("Smoothing parameters are selected by ",Method,"with alpha=",x$alpha,".",sep="") 19 cat("\n") 20 ## the rest are suppressed 21 invisible() 22} 23 24## Print function for ssanova0 objects 25print.ssanova0 <- function(x,...) 26{ 27 ## call 28 cat("\nCall:\n",deparse(x$call),"\n\n",sep="") 29 ## terms 30 cat("Terms:\n") 31 print.default(c(x$terms$labels,x$lab.p)) 32 cat("\n") 33 ## terms overview 34 cat("Number of unpenalized and penalized terms:\n\n") 35 print.default(x$desc) 36 cat("\n") 37 if (x$method=="v") Method <- "GCV.\n" 38 if (x$method=="m") Method <- "GML.\n" 39 if (x$method=="u") Method <- "Mallows CL.\n" 40 cat("Smoothing parameters are selected by",Method) 41 cat("\n") 42 ## the rest are suppressed 43 invisible() 44} 45 46## Print function for gssanova objects 47print.gssanova <- function(x,...) 48{ 49 ## call 50 cat("\nCall:\n",deparse(x$call),"\n\n",sep="") 51 ## terms 52 cat("Terms:\n") 53 print.default(c(x$terms$labels,x$lab.p)) 54 cat("\n") 55 ## terms overview 56 cat("Number of unpenalized and penalized terms:\n\n") 57 print.default(x$desc) 58 cat("\n") 59 cat("Smoothing parameters are selected by CV with alpha=",x$alpha,".",sep="") 60 cat("\n") 61 ## the rest are suppressed 62 invisible() 63} 64 65## Print function for ssden objects 66print.ssden <- function(x,...) 67{ 68 ## call 69 cat("\nCall:\n",deparse(x$call),"\n\n",sep="") 70 ## terms 71 cat("Terms:\n") 72 print.default(x$terms$labels) 73 cat("\n") 74 ## terms overview 75 cat("Number of unpenalized and penalized terms:\n\n") 76 print.default(x$desc) 77 cat("\n") 78 cat("Smoothing parameters are selected by CV with alpha=",x$alpha,".",sep="") 79 cat("\n") 80 ## the rest are suppressed 81 invisible() 82} 83 84## Print function for sscden objects 85print.sscden <- function(x,...) 86{ 87 ## call 88 cat("\nCall:\n",deparse(x$call),"\n\n",sep="") 89 ## terms 90 cat("Terms:\n") 91 print.default(x$terms$labels) 92 cat("\n") 93 ## terms overview 94 cat("Number of unpenalized and penalized terms:\n\n") 95 print.default(x$desc) 96 cat("\n") 97 cat("Smoothing parameters are selected by CV with alpha=",x$alpha,".",sep="") 98 cat("\n") 99 ## the rest are suppressed 100 invisible() 101} 102 103## Print function for sshzd objects 104print.sshzd <- function(x,...) 105{ 106 ## call 107 cat("\nCall:\n",deparse(x$call),"\n\n",sep="") 108 ## terms 109 cat("Terms:\n") 110 print.default(c(x$terms$labels,x$lab.p)) 111 cat("\n") 112 ## terms overview 113 cat("Number of unpenalized and penalized terms:\n\n") 114 print.default(x$desc) 115 cat("\n") 116 cat("Smoothing parameters are selected by CV with alpha=",x$alpha,".",sep="") 117 cat("\n") 118 ## the rest are suppressed 119 invisible() 120} 121 122## Print function for sshzd objects 123print.sscox <- function(x,...) 124{ 125 ## call 126 cat("\nCall:\n",deparse(x$call),"\n\n",sep="") 127 ## terms 128 cat("Terms:\n") 129 print.default(c(x$terms$labels,x$lab.p)) 130 cat("\n") 131 ## terms overview 132 cat("Number of unpenalized and penalized terms:\n\n") 133 print.default(x$desc) 134 cat("\n") 135 cat("Smoothing parameters are selected by CV with alpha=",x$alpha,".",sep="") 136 cat("\n") 137 ## the rest are suppressed 138 invisible() 139} 140 141## Print function for ssllrm objects 142print.ssllrm <- function(x,...) 143{ 144 ## call 145 cat("\nCall:\n",deparse(x$call),"\n\n",sep="") 146 ## terms 147 cat("Terms:\n") 148 print.default(x$terms$labels) 149 cat("\n") 150 ## terms overview 151 cat("Number of unpenalized and penalized terms:\n\n") 152 print.default(x$desc) 153 cat("\n") 154 cat("Smoothing parameters are selected by CV with alpha=",x$alpha,".",sep="") 155 cat("\n") 156 ## the rest are suppressed 157 invisible() 158} 159 160## Print function for summary.ssanova objects 161print.summary.ssanova <- function (x,digits=6,...) 162{ 163 ## call 164 cat("\nCall:\n",deparse(x$call),"\n",sep="") 165 cat("\nEstimate of error standard deviation:",x$sigma,"\n") 166 ## residuals 167 res <- x$res 168 cat("\nResiduals:\n") 169 nam <- c("Min", "1Q", "Median", "3Q", "Max") 170 rq <- structure(quantile(res), names = nam) 171 print(rq,digits=digits) 172 cat("Residual sum of squares:",x$rss) 173 cat("\nR square:",x$r.squared) 174 ## selected summaries 175 cat("\n\nPenalty associated with the fit:",x$pen) 176 cat("\n\n") 177 invisible() 178} 179 180## Print function for summary.gssanova objects 181print.summary.gssanova <- function (x,digits=6,...) 182{ 183 ## call 184 cat("\nCall:\n",deparse(x$call),"\n",sep="") 185 if (x$family%in%c("Gamma","inverse.gaussian")) { 186 cat("\n(Dispersion parameter for ",x$family, 187 " family estimated to be ",format(x$dispersion),")\n\n",sep="") 188 } 189 else { 190 cat("\n(Dispersion parameter for ",x$family, 191 " family taken to be ",format(x$dispersion),")\n\n",sep="") 192 } 193 ## residuals 194 res <- x$res 195 cat("Working residuals (weighted):\n") 196 nam <- c("Min", "1Q", "Median", "3Q", "Max") 197 rq <- structure(quantile(res), names = nam) 198 print(rq,digits=digits) 199 cat("Residual sum of squares:",x$rss,"\n") 200 ## deviance residuals 201 res <- x$dev.res 202 cat("\nDeviance residuals:\n") 203 nam <- c("Min", "1Q", "Median", "3Q", "Max") 204 rq <- structure(quantile(res), names = nam) 205 print(rq,digits=digits) 206 cat("Deviance:",x$deviance) 207 cat("\nNull deviance:",x$dev.null) 208 ## selected summaries 209 cat("\n\nPenalty associated with the fit:",x$pen) 210 cat("\n\n") 211 invisible() 212} 213 214## Print function for summary.gssanova objects 215print.summary.gssanova0 <- function (x,digits=6,...) 216{ 217 ## call 218 cat("\nCall:\n",deparse(x$call),"\n",sep="") 219 if (x$method=="u") 220 cat("\n(Dispersion parameter for ",x$family, 221 " family taken to be ",format(x$dispersion),")\n\n",sep="") 222 if (x$method=="v") 223 cat("\n(Dispersion parameter for ",x$family, 224 " family estimated to be ",format(x$dispersion),")\n\n",sep="") 225 ## residuals 226 res <- x$res 227 cat("Working residuals (weighted):\n") 228 nam <- c("Min", "1Q", "Median", "3Q", "Max") 229 rq <- structure(quantile(res), names = nam) 230 print(rq,digits=digits) 231 cat("Residual sum of squares:",x$rss,"\n") 232 ## deviance residuals 233 res <- x$dev.res 234 cat("\nDeviance residuals:\n") 235 nam <- c("Min", "1Q", "Median", "3Q", "Max") 236 rq <- structure(quantile(res), names = nam) 237 print(rq,digits=digits) 238 cat("Deviance:",x$deviance) 239 cat("\nNull deviance:",x$dev.null) 240 ## selected summaries 241 cat("\n\nPenalty associated with the fit:",x$pen) 242 cat("\n\nNumber of performance-oriented iterations:",x$iter) 243 cat("\n\n") 244 invisible() 245} 246 247## Print function for sscopu objects 248print.sscopu <- function(x,...) 249{ 250 ## call 251 cat("\nCall:\n",deparse(x$call),"\n\n",sep="") 252 ## dimension 253 cat("Dimemsion: ",dim(x$basis)[2],".",sep="") 254 cat("\n\n") 255 order <- x$order 256 if (is.null(order)) order <- 2 257 cat("Maximum order of interaction: ",order,".",sep="") 258 cat("\n\n") 259 if (x$symmetry) { 260 cat("The fit is symmetric, invariant to variable permutation.") 261 cat("\n\n") 262 } 263 cat("Smoothing parameters are selected by CV with alpha=",x$alpha,".",sep="") 264 cat("\n") 265 ## the rest are suppressed 266 invisible() 267} 268 269## Print function for sshzd2d objects 270print.sshzd2d <- function(x,...) 271{ 272 ## call 273 cat("\nCall:\n",deparse(x$call),"\n\n",sep="") 274 if (x$symmetry) { 275 cat("The fit is symmetric, with a common marginal hazard and a symmetric copula.") 276 cat("\n\n") 277 } 278 ## terms 279 cat("Terms in hzd1:\n") 280 print.default(c(x$hzd1$terms$labels,x$hzd1$lab.p)) 281 ## terms overview 282 cat("Number of unpenalized and penalized terms:\n") 283 print.default(x$hzd1$desc) 284 cat("\n") 285 cat("Terms in hzd2:\n") 286 print.default(c(x$hzd2$terms$labels,x$hzd2$lab.p)) 287 ## terms overview 288 cat("Number of unpenalized and penalized terms:\n") 289 print.default(x$hzd2$desc) 290 cat("\n") 291 cat("Smoothing parameters are selected by CV with alpha=",x$alpha,".",sep="") 292 cat("\n") 293 ## the rest are suppressed 294 invisible() 295} 296