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 aldvmm.pred.

X

a list of design matrices returned by aldvmm.mm. 'X' is of length 2 and includes a design matrix for the model of component distributions and a design matrix for the model of probabilities of group membership.

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. c(-0.594, 0.883)). The potential gap between the maximum value and 1 represents an area with zero density in the value set from which utilities were obtained. The order of the minimum and maximum limits in 'psi' does not matter.

cv

a numeric matrix with covariances/variances of parameter estimates returned by aldvmm.cv.

mse

a numeric value of the mean squared error of observed versus predicted outcomes \sum{(y - \hat{y})^2}/(n_{obs} - n_{par}) for all observations in model matrices 'X' supplied to aldvmm.ll.

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 'psi'.

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 "normal".

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 "beta") and coefficients of probabilities of component membership (default "delta").

lcmp

a character value representing a stub (default "Comp") for labeling objects including regression coefficients in different components (e.g. "Comp1", "Comp2", ...). This label is also used in summary tables returned by summary.aldvmm.

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 'lcpar' depends on the distribution supplied to 'dist'.

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), 141-143. 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/1475-6773.12122


[Package aldvmm version 0.8.8 Index]