Introduction
On this page you will find information of the psfmi package. The package contains functions to apply pooling or backward selection (BWS) for logistic, Cox regression and Multilevel (Mixed models) prediction models in multiply imputed datasets.
The basic pooling method is Rubin’s Rules. For categorical predictors, different methods to derive pooled p-values are available as: the D1, D2, D3 and MPR (Median R Rule) method. Also restricted cubic spline coefficients can be used. Two-way interaction terms between continuous, dichotomous and categorical predictors are also possible in the model. All these type of predictors, interaction terms or a combination, can be forced in the model during BWS. Furthermore, the stability of models selected and the bootstrap inclusion frequency can be evaluated. For logistic and Cox regression models bootstrapping is than used and for Multilevel models cluster bootstrapping.
The package also contains a function to generate pooled model performance measures over imputed datasets as ROC/AUC, Nagelkerke R-squares, Brier score and calibration plots. A function to apply Bootstrap internal validation
is also available where two methods can be used to combine bootstrapping and multiple imputationfor internal validation. One method, boot_MI, first draws bootstrap samples and subsequently performs multiple imputation and with the other method, MI_boot, first bootstrap samples are drawn from each imputed dataset before results are combined. Backward selection as part of internal validation is also an option. A function with the name mivalext_lr can be used to externally validate prediction models in multiply imputed datasets. The following information of the externally validated model is provided: pooled ROC/AUC, (Nagelkerke) R-Square value, Hosmer and Lemeshow Test, pooled coefficients when the model is freely estimated in imputed datasets and the pooled linear predictor (LP), with information about miscalibration in intercept and slope.
Installing the psfmi package
The package can be installed from CRAN and the development version from Github by running the following code in the R console window:
install.packages(“devtools”)
library(devtools)
devtools::install_github(“mwheymans/psfmi”)
library(psfmi)
Main functions
The main functions that are available in the psfmi package are:
psfmi_lr: pooling and selection of Logistic regression models in multiply imputed datasets.
psfmi_coxr: pooling and selection of Cox regression models in multiply imputed datasets.
psfmi_mm: pooling and selection of linear and logistic Mixed models in multiply imputed datasets.
psfmi_stab: stability evaluation of models and predictors in multiply imputed datasets.
psfmi_perform: performance and internal validation of logistic regression models in multiply imputed datasets.
mivalext_lr: external validation in multiply imputed datasets.