LRupdate: LRupdate

View source: R/LRupdate.r

LRupdateR Documentation

LRupdate

Description

Update Model LR Statistics After Multiple Imputation

Usage

LRupdate(fit, anova)

Arguments

fit

an rms fit object

anova

the result of processMI(..., 'anova')

Details

For fits from ⁠orm, lrm, orm, cph, psm⁠ that were created using fit.mult.impute with lrt=TRUE or equivalent options and for which anova was obtained using processMI(fit, 'anova') to compute imputation-adjusted LR statistics. LRupdate uses the last line of the anova result (containing the overall model LR chi-square) to update ⁠Model L.R.⁠ in the fit stats component, and to adjust any of the new R-square measures in stats.

For models using Nagelkerke's R-squared, these are set to NA as they would need to be recomputed with a new intercept-only log-likelihood, which is not computed by anova. For ols models, R-squared is left alone as it is sample-size-independent and print.ols prints the correct adjusted R-squared due to fit.mult.impute correcting the residual d.f. in stacked fits.

Value

new fit object like fit but with the substitutions made

Author(s)

Frank Harrell

See Also

processMI.fit.mult.impute(), Hmisc::R2Measures()

Examples

## Not run: 
a <- aregImpute(~ y + x1 + x2, n.impute=30, data=d)
f <- fit.mult.impute(y ~ x1 + x2, lrm, a, data=d, lrt=TRUE)
a <- processMI(f, 'anova')
f <- LRupdate(f, a)
print(f, r2=1:4)   # print all imputation-corrected R2 measures

## End(Not run)

rms documentation built on Sept. 12, 2023, 9:07 a.m.