smooth.spec | R Documentation |
Specifies the covariates to be considered as penalized splines.
smooth.spec(
...,
knots = NULL,
df = NULL,
by = NULL,
option = NULL,
same.rho = FALSE
)
... |
Numeric vectors specified in |
knots |
List of numeric vectors that specifies the knots of the splines (including boundaries); default is NULL |
df |
Degrees of freedom: numeric vector that indicates the number of knots desired for each covariate; default is NULL |
by |
numeric or factor variable in order to define a varying coefficient smooth; default is NULL |
option |
"smf", "tensor" or "tint". Depends on the wrapper function; default is "smf" |
same.rho |
if there is a factor by variable, should the smoothing parameters be the same for all levels; default is FALSE. |
object of class smooth.spec
term |
Vector of strings giving the names of each covariate specified in ... |
dim |
Numeric value giving the number of covariates associated with this spline |
knots |
list of numeric vectors that specifies the knots for each covariate |
df |
Numeric vector giving the number of knots associated with each covariate |
by |
numeric or factor variable in order to define a varying coefficient smooth |
same.rho |
if there is a factor by variable, should the smoothing parameters be the same for all levels; default is FALSE |
name |
simplified name of the call to function smooth.spec |
library(survPen)
# standard spline of time with 10 unspecified knots
smooth.spec(time)
# tensor of time and age with 5*5 specified knots
smooth.s <- smooth.spec(time,age,knots=list(time=seq(0,5,length=5),age=seq(20,80,length=5)),
option="tensor")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.