miMeanSEAux
is generic (see Methods); method functions
can be written to handle specific classes of data.
Classes which already have methods include:
lm
.
miMeanSE(object, ...) miMeanSEAux(object1, object, ...) # Remaining functions are described in separate help files miMeanSEDefault(estimate, se, df = NA, n = df+k, sse = F, cov, ...) miMeanSEMatrix(object, columns = 1:2, ...) miMeanSEList(object, estimate = "estimate", se = "se", df = "df", n = "n", sse = F, cov, ...) miMeanSEAux.lm(object1, object, ...) # lm objects
miSubscript(object, 1)
; used for dispatching.
miMeanSEAux
.
cov
is supplied in the input, then the following component
is added to the returned list:
est
; diagonal elements of this match
the squared
std.err
.
This function
computes averages (across multiple imputations) of estimates,
and computes standard errors or covariance matrices for
those estimates, based on the individual standard errors or covariances
and the variability of the estimates across imputations.
miMeanSE
checks that all imputations have the same class,
then calls generic function
miMeanSEAux
which
dispatches based on that class
(the method to use in combining multiple imputations
depends not on the class of
object
but rather on the class
of the imputations of
object
).
For example, if
object
is
an
miList
object whose imputations are
lm
objects,
then
miMeanSEAux
dispatches to its
lm
method.
Use
getMethods("miMeanSEAux")
to see what methods have been defined.
The ultimate workhorse is
miMeanSEDefault
.
miMeanSE
and
miMeanSEAux
together
serve as a front end for
miMeanSEDefault
.
Other front ends for
miMeanSEDefault
are
miMeanSEList
and
miMeanSEMatrix
.
These require multiple imputation objects whose
imputations correspond respectively to
(1) lists whose elements are estimates, standard errors, etc. or
(2) matrices whose first two columns (by default) are
estimates and standard errors.
Hesterberg, T. (1998).
Combining multiple imputation t, chi-square, and F inferences ,
Insightful Technical Report number 75.
Rubin, D. B. (1987),
Multiple imputation for nonresponse in surveys ,
John Wiley, New York.
Schafer, J. L. (1997),
Analysis of Incomplete Multivariate Data ,
Chapman & Hall, London.
fit <- miEval(lm(chol14~., data = cholesterolImpExample)) # Best choice in this example is to use the lm method, # which extracts all needed info, & produces estimates, # standard errors, and covariance estimates for coefficients miMeanSE(fit) # Various other ways to do calculations are below; # these require estimates and standard errors sumfit <- miEval(summary(fit)) coefs <- miEval(coef(sumfit)) coefs[[1]] # note estimates and std errors # pass estimates and standard errors miMeanSE(miEval(coefs[,1]), miEval(coefs[,2])) # pass matrices, cols 1:2 are estimate & std err miMeanSEMatrix(coefs) # pass lists miMeanSEList(miEval(list(estimate = coefs[,1], se = coefs[,2]))) # Can add information to some of previous calls, e.g. # residual degrees of freedom miMeanSEMatrix(coefs, df = nrow(cholesterolImpExample)-3)