Description Usage Arguments Methods (by class) See Also Examples
View source: R/rms_po_assume.R
Based on code and strategy outlined in Frank Harrell's Regression Modeling Strategies (see citation below).
1 2 3 4 5 6 7 8 9 | rms_po_assume(lrmObj = NULL, ...)
## S3 method for class 'fit.mult.impute'
rms_po_assume(lrmObj, cuts, plotVars = NULL,
mfrowAuto = FALSE, modelData, impObj, plotType = c("ggplot", "base"))
## Default S3 method:
rms_po_assume(lrmObj, cuts, plotVars = NULL,
mfrowAuto = FALSE, modelData, plotType = c("ggplot", "base"))
|
cuts |
Numeric vector; sequence of points to cut outcome. Should not include lowest outcome level. |
plotVars |
Character vector; which variables to plot. Defaults to all. |
mfrowAuto |
Logical; whether to determine par(mfrow = ...) automatically. Defaults to FALSE. |
modelData |
Data.frame; data set used to fit original model. Used to fit logistic models with outcome dichotomized at each cut point. |
impObj |
aregImpute or mice object used to fit original model in fit.mult.impute. |
rmsObj |
Model fit of class 'lrm'. |
fit.mult.impute
: Method for lrm() models fit with fit.mult.impute.
default
: Method for lrm() model fits without imputation.
Harrell FE. *Regression Modeling Strategies: with applications to linear models, logistic regression, and survival analysis.* New York: Springer Science + Business Media, LLC, 2001.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Regular lrm() model, no imputation
df <- data.frame(ptclass = sample(1:4, size = 20, replace = TRUE),
v1 = rnorm(n = 20),
v2 = rnorm(mean = 5, sd = 1, n = 20))
mymod <- lrm(ptclass ~ v1 + v2, data = df)
rms_po_assume(mymod, cuts = 2:4, modelData = df)
## Model using imputation
df$v1[sample(1:nrow(df), size = 5)] <- NA
aregdf <- aregImpute(~ ptclass + v1 + v2, nk = 0, data = df)
mymodImp <- fit.mult.impute(ptclass ~ v1 + v2, fitter = lrm, xtrans = aregdf, data = df)
rms_po_assume(mymodImp, cuts = 2:4, impObj = aregdf, modelData = df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.