Description Usage Arguments Details Author(s) References See Also Examples
These functions provide a "mira"
method for the linearHypothesis
function in the car package, along with basic coef
and vcov
methods that apply “Rubin's Rules” for combining estimates across imputations. mira
objects are produced by fitting statistical models to multiply imputed data sets using functions in the mice package: mice-package
.
1 2 3 4 5 6 |
model, object |
an object of class |
hypothesis.matrix |
hypothesis in matrix or symbolic form: see |
rhs |
right-hand side vector for the hypothesis, defaults to zeros. |
... |
not used. |
Wald test statistics and degrees of freedom for linear hypotheses are computed by the approximate method described in Reiter (2007) if the complete-data residual degrees of freedom are known and by the method in Rubin (1987) if they are not.
John Fox jfox@mcmaster.ca
J. Fox, Applied Regression Analysis and Generalized Linear Models, 3rd ed., Sage, 2016.
S. van Buuren, Flexible Imputation of Missing Data, 2nd ed., Chapman and Hall, 2018.
J. P. Reiter, Small-sample degrees of freedom for multi-component significance tests with multiple imputation for missing data. Biometrika, 2007, 94: 502-508.
D. B. Rubin, Multiple Imputation for Nonresponse in Surveys, Wiley, 1987.
linearHypothesis
, mira
, mice-package
.
1 2 3 4 5 6 7 8 9 10 11 12 | if (require(mice)){
nhanes2$age <- factor(nhanes2$age,
labels=c("age20.39", "40.59", "60.99"))
imps <- mice(nhanes2, m=10, print=FALSE, seed=12345)
models <- with(imps, lm(chl ~ age + bmi))
linearHypothesis(models, c("age40.59", "age60.99"))
}
if (require(mice)){
linearHypothesis(models, "age40.59 = age60.99")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.