### To compare two linear models:
imp <- mice(nhanes2)
mi1 <- with(data=imp, expr=lm(bmi~age+hyp+chl))
mi0 <- with(data=imp, expr=lm(bmi~age+hyp))
pc <- pool.compare(mi1, mi0, method='Wald')
pc$spvalue
# [,1]
#[1,] 0.000293631
#
### Comparison of two general linear models (logistic regression).
imp <- mice(boys, maxit=2)
fit0 <- with(imp, glm(gen>levels(gen)[1] ~ hgt+hc,family=binomial))
fit1 <- with(imp, glm(gen>levels(gen)[1] ~ hgt+hc+reg,family=binomial))
pool.compare(fit1, fit0, method='likelihood', data=imp)
Run the code above in your browser using DataLab