semiVarReg | R Documentation |
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.
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(...),
...
)
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 |
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 |
meanmodel |
Text to specify the mean model to be fit to the data. The possible inputs are
|
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= |
varmodel |
Text to specify the variance model to be fit to the data. The possible inputs are
|
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 |
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 |
degree |
Integer indicating the degree of the splines fit in the mean and the variance models.
The default value is |
mono.var |
Text to indicate whether the variance model is monotonic. Note that this is not
available for the |
para.space |
Text to indicate the parameter space to search for scale2 parameter estimates.
|
control |
list of control parameters. See |
... |
arguments to be used to form the default control argument if it is not supplied directly |
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:
modeltype
: Text indicating the model that was fit, indicating if a censored approach or an uncensored approach was performed.
knots.m
, knots.v
, degree
, meanmodel
, varmodel
: Returning the input variables as described above
converged
: Logical argument indicating if convergence occurred.
iterations
: Total iterations performed.
reldiff
: the positive convergence tolerance that occurred at the final iteration.
loglik
: Numeric variable of the maximised log-likelihood.
boundary
: Logical argument indicating if the MLE is on the boundary of the parameter space.
aic.c
: Akaike information criterion corrected for small samples
aic
: Akaike information criterion
bic
: Bayesian information criterion
hqc
: Hannan-Quinn information criterion
mean.ind
: Vector of integer(s) indicating the column number(s) in the dataframe
data
that were fit in the mean model.
mean
: Vector of the maximum likelihood estimates of the mean parameters.
var.ind
: Vector of integer(s) indicating the column(s) in the dataframe
data
that were fit in the variance model.
variance
: Vector of the maximum likelihood estimates of the variance parameters.
cens.ind
: Integer indicating the column in the dataframe data
that
corresponds to the censoring indicator.
data
: Dataframe containing the variables included in the model.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.