lssVarReg.multi performs a semiparametric location (\(\xi\) or xi), shape (\(\nu\) or nu) and scale (\(\omega\) or omega) regression model. This is designed for multiple covariates that are fit in the location, scale and shape models.
lssVarReg.multi(
y,
x,
locationmodel = c("constant", "linear", "semi"),
location.vars = c(1),
scale2model = c("constant", "linear", "semi"),
scale2.vars = c(1),
shapemodel = c("constant", "linear", "semi"),
shape.vars = c(1),
knots.l = NULL,
knots.sc = NULL,
knots.sh = NULL,
degree = 2,
location.init = NULL,
scale2.init = NULL,
shape.init = NULL,
int.maxit = 1000,
print.it = FALSE,
control = list(...),
...
)lssVarReg returns an object of class "lssVarReg", which inherits most from class
"VarReg". This object of class lssVarReg is a list of the following components:
modeltype: Text indicating the model that was fit, always "LSS model" for this model.
locationmodel, scale2model, shapemodel, knots.l, knots.sc,
knots.sh, degree,mono.scale : Returning the input variables as described above
converged: Logical argument indicating if convergence occurred.
iterations: Total iterations performed of the main algorithm (not including the
internal EM algorithm).
reldiff: the positive convergence tolerance that occured at the final iteration.
loglik: Numeric variable of the maximised log-likelihood.
aic.c: Akaike information criterion corrected for small samples
aic: Akaike information criterion
bic: Bayesian information criterion
hqc: Hannan-Quinn information criterion
location: Vector of the maximum likelihood estimates of the location parameters.
scale2: Vector of the maximum likelihood estimates of the scale (squared) parameters.
shape: Vector of the maximum likelihood estimates of the shape parameters.
data: Dataframe containing the variables included in the model.
Vector containing outcome data. Must be no missing data.
Matrix containing the covariate data, same length as y. Must be no missing data.
Vector to specify the location model to be fit for each covariate. Options: "constant" = constant model (intercept only), "linear" = linear term with x covariate, "semi" = semiparametric spline (specify with knots.l).
Vector to specify the column(s) in x referring to covariates to be fit in the location model, eg c(1,2) indicates columns 1 and 2 in x. Must be the same length as locationmodel which specifies if they are fit as linear/semi. If semi, use knots.l to specify knots.
Vector to specify the scale^2 model to be fit for each covariate. Options: "constant" = constant term only, "linear" = linear term with x covariate, "semi" = semiparametric spline (specify with knots.sc)
Vector to specify the column(s) in x referring to covariates to be fit in the scale^2 model, eg c(1,2) indicates columns 1 and 2 in x. Must be the same length as scale2model which specifies if they are fit as linear/semi. If semi, use knots.sc to specify knots.
Vector to specify the shape model to be fit for each covariate. Options: "constant" = constant shape model, "linear" = linear term with x covariate, "semi" = semiparametric spline (specify with knots.sh).
Vector to specify the column(s) in x referring to covariates to be fit in the shape model, eg c(1,2) indicates columns 1 and 2 in x. Must be the same length as shapemodel which specifies if they are fit as linear/semi. If semi, use knots.sh to specify knots.
Vector indicating the number of internal knots to be fit in the location model for each covariate. Default is '2'. (Note that the knots are placed equidistantly over x.)
Vector indicating the number of internal knots to be fit in the scale^2 model for each covariate. Default is '2'. (Note that the knots are placed equidistantly over x.)
Vector indicating the number of internal knots to be fit in the shape model for each covariate. Default is '2'. (Note that the knots are placed equidistantly over x.)
Integer to indicate the degree of the splines fit in the location, scale and shape. Default is '2'.
Vector of initial parameter estimates for the location model. Defaults to vector of 1's of appropriate length.
Vector of initial parameter estimates for the scale^2 model. Defaults to vector of 1's of appropriate length.
Vector of initial parameter estimates for the shape model. Defaults to vector of 1's of appropriate length.
Integer of maximum iterations for the internal location and scale EM algorithm. Default is 1000 iterations.
Logical for printing progress of estimates through each iteration. Default is FALSE.
List of control parameters for the algorithm. See VarReg.control.
arguments to be used to form the default control argument if it is not supplied directly
VarReg.control plotlssVarReg
## not run
## library(palmerpenguins)
## cc<-na.omit(penguins)
## y<-cc$body_mass_g
## x<-as.data.frame(cbind(cc$bill_length_mm, cc$flipper_length_mm,cc$bill_depth_mm))
## colnames(x) <-c("bill length mm", "flipper length mm","bill depth mm")
## model1<-lssVarReg.multi(y, x,
## locationmodel="linear", location.vars = 2,
## scale2model="constant",
## shapemodel=c("linear", "semi"), shape.vars = c(2,3),
## knots.sh = 1, int.maxit=10 )
## model1[-21] ## print model
Run the code above in your browser using DataLab