aldvmm.sefit {aldvmm}  R Documentation 
Calculating Standard Errors of Fitted and Predicted Outcomes
Description
aldvmm.sefit
calculates standard errors of fitted and predicted outcomes using the delta
method.
Usage
aldvmm.sefit(
par,
yhat,
X,
type,
psi,
cv,
mse = NA,
ncmp,
dist,
level,
lcoef,
lcmp,
lcpar
)
Arguments
par 
a named numeric vector of parameter values. 
yhat 
a numeric vector of predicted outcomes returned by

X 
a list of design matrices returned by

type 
a character value of either 'fit' or 'pred' indicating whether the standard error of the fit ('fit') or the standard error of predictions in new data ('pred') are calculated. 
psi 
a numeric vector of minimum and maximum possible utility values
smaller than or equal to 1 (e.g. 
cv 
a numeric matrix with covariances/variances of parameter estimates
returned by

mse 
a numeric value of the mean squared error of observed versus
predicted outcomes 
ncmp 
a numeric value of the number of components that are mixed. The
default value is 2. A value of 1 represents a tobit model with a gap
between 1 and the maximum value in 
dist 
an optional character value of the distribution used in the
components. In this release, only the normal distribution is
available, and the default value is set to 
level 
a numeric value of the significance level for confidence bands of fitted values. The default value is 0.95. 
lcoef 
a character vector of length 2 with labels of objects including
regression coefficients of component distributions (default 
lcmp 
a character value representing a stub (default 
lcpar 
a character vector with the labels of objects including
constant parameters of component distributions (e.g. the standard
deviation of the normal distribution). The length of 
Details
aldvmm.sefit
calculates standard errors of fitted values using the delta method. Standard
errors of fitted values in the estimation data set are calculated as
se_{fit} = \sqrt{G^{t} \Sigma G}
,
where G
is the gradient of a fitted value with respect to changes of
parameter estimates, and \Sigma
is the estimated covariance matrix of
parameters (Dowd et al., 2014). Standard errors of predicted values in new
data sets are calculated as se_{pred} = \sqrt{MSE + G^{t} \Sigma
G}
, where MSE
is the
mean squared error of fitted versus observed outcomes in the original
estimation data (Whitmore, 1986). The gradients of fitted values with
respect to parameter estimates are approximated numerically using
jacobian
.
Value
a named numeric vector of standard errors of fitted or predicted
outcomes. The names of the elements in the vector are identical to the row
names of design matrices in 'X'
References
Whitmore, G. A. (1986). Prediction limits for a univariate
normal observation. The American Statistician, 40(2), 141143.
https://doi.org/10.1080/00031305.1986.10475378
Dowd, B. E., Greene, W. H., and Norton, E. C. (2014) Computation of standard errors. Health services research, 49(2), 731–750. doi:10.1111/14756773.12122