semiVarReg {VarReg}R Documentation

Semi parametric mean and variance regression

Description

semiVarReg performs semi-parametric mean and variance regression models. Currently, this is only designed for a single covariate that is fit in the mean and variance models.

Usage

semiVarReg(
  y,
  x,
  cens.ind = NULL,
  meanmodel = c("zero", "constant", "linear", "semi"),
  mean.intercept = TRUE,
  varmodel = c("constant", "linear", "semi"),
  knots.m = 2,
  knots.v = 2,
  degree = 2,
  mono.var = c("none", "inc", "dec"),
  para.space = c("all", "positive", "negative"),
  control = list(...),
  ...
)

Arguments

y

Vector containing outcome data. Must be no missing data and any censored values must be set to the limits of detection.

x

Vector containing the covariate data. Must be no missing data and same length as y.

cens.ind

Vector containing the censoring indicator, if applicable. There must be no missing data contained in the vector and this vector should be the same length as y. "0" values indicate uncensored data, "1" indicates right, or upper, censoring and "-1" indicates left, or lower, censoring. The default is NULL which indicates there is no censored data.

meanmodel

Text to specify the mean model to be fit to the data. The possible inputs are "zero", "constant", "linear" or "semi". "semi" indicates a semi-parametric spline model, with the number of internal knots specified in knots.m.

mean.intercept

Logical argument to indicate if the mean model is to include an intercept term. This option is only available in the censored mean model, and the default=TRUE.

varmodel

Text to specify the variance model to be fit to the data. The possible inputs are "constant", "linear" or "semi". "semi" indicates a semi-parametric B-spline model, with the number of internal knots specified in knots.v.

knots.m

Integer indicating the number of internal knots to be fit in the semi-parametric mean model. Knots are placed equidistantly over the covariate. The default value is 2.

knots.v

Integer indicating the number of internal knots to be fit in the semi-parametric variance model. Knots are placed equidistantly over the covariate. The default value is 2.

degree

Integer indicating the degree of the splines fit in the mean and the variance models. The default value is 2.

mono.var

Text to indicate whether the variance model is monotonic. Note that this is not available for the "constant" variance model. Options are "none", "inc" or "dec", with the default="none". "Inc" indicates increasing monotonic and "dec" indicates decreasing monotonic. If the variance model is linear, the parameter space is constrained (positive for increasing and negative for decreasing). For semi-parametric variance models, the appropriate monotonic B-splines are fit in the semi-parametric variance model.

para.space

Text to indicate the parameter space to search for scale2 parameter estimates. "positive" means only search positive parameter space, "negative" means search only negative parameter space and "all" means search all parameter spaces. Default is all.

control

list of control parameters. See VarReg.control.

...

arguments to be used to form the default control argument if it is not supplied directly

Value

semiVarReg returns an object of class "VarReg" which inherits some components from the class "glm". This object of class "VarReg" is a list containing the following components:

Examples

data(mcycle)
## run a model with linear mean and linear variance:
linmodel<-semiVarReg(mcycle$accel, mcycle$times, meanmodel="linear", varmodel="linear",
 maxit=10000)
## run a model with semi-parametric mean (4 internal knots) and semi-parametric variance (2 knots):
##not run
##semimodel<-semiVarReg(mcycle$accel, mcycle$times, meanmodel="semi", varmodel="semi",
##knots.m=4, knots.v=2, maxit=10000)
## run a model with semi-parametric mean (4 internal knots) and semi-parametric monotonic
## variance (2 knots):
## not run
##semimodel_inc<-semiVarReg(mcycle$accel, mcycle$times, meanmodel="semi", varmodel="semi",
##knots.m=4, knots.v=2, mono.var="inc")

[Package VarReg version 2.0 Index]