seVarReg
calculates SE for an object of class VarReg
. If the result is not on a
boundary, the Fishers Information matrix SE are given. The bootstrapped 95% CI can also be
calculated. Designed to be called by the plot function plotVarReg
, rather than run by a user.
Usage
seVarReg(
x,
boot = FALSE,
bootreps = 1000,
vector.mean = x$data[, 2],
vector.variance = x$data[, 2],
control = list(...),
...
)
Arguments
- x
Object of class
VarReg
to determin the SE (eg. result fromsemiVarReg
).- boot
Logical to indicate if bootstrapped CI should be calculated. Default is
FALSE
.- bootreps
Number of bootstraps to be performed if
boot=TRUE
. Default is1000
.- vector.mean
Vector of
x
values for which the SE of the mean is to be calculated. Default is thex
covariate from the model.- vector.variance
Vector of
x
values for which the SE of the variance is to be calculated. Default is the actualx
covariate from the model.- control
List of control parameters for the bootstrapped models. See
VarReg.control
.- ...
arguments to be used to form the default control argument if it is not supplied directly
Value
The result is a list of results. This includes:
mean.est
: dataframe of overall results from the mean model, including parameter estimates from the model, SEs from information matrix (ifboundary=FALSE
) and if specified, the SE from bootstrapping with the bootstrapped 95% CI.variance.est
: dataframe of overall results from the variance model, including parameter estimates from the model, SEs from information matrix (ifboundary=FALSE
) and if specified, the SE from bootstrapping with the bootstrapped 95% CI.mean.im
: dataframe of the expected information matrices for the mean (as appropriate)variance.im
: dataframe of the expected information matrices for the variance (as appropriate)mean.outputs
: dataframe with complete output for mean graphics. Includes thevector.mean
as input, and the mean vector (mean.mean
) and the SE vectormean.se.im
, and bootstrapping outputs as appropriate.variance.outputs
: dataframe with complete output for variance graphics. Includes thevector.variance
as input, and the mean vector (var.mean
) and the SE vectorvar.se.im
, and bootstrapping outputs as appropriate.
Examples
data(mcycle)
##Fit model with range as a covariate in the mean and the variance model
semimodel<-semiVarReg(mcycle$accel, mcycle$times, meanmodel="semi", varmodel="linear",
knots.m=4, maxit=10000)
##Calculate SE
se1<-seVarReg(semimodel, boot=FALSE)
##not run: with bootstrapping
##se2<-seVarReg(semimodel, boot=TRUE, bootreps=10)
##not run: calculate mean and SE for a given sequence
##test.seq<-seq(min(mcycle$times), max(mcycle$times),
##by=((max(mcycle$times)-min(mcycle$times))/999))
##se2<-seVarReg(semimodel, boot=TRUE, bootreps=10, vector.mean=test.seq)