psfmi_lm {psfmi}R Documentation

Pooling and Predictor selection function for backward or forward selection of Linear regression models across multiply imputed data.

Description

psfmi_lm Pooling and backward or forward selection of Linear regression models in multiply imputed data using selection methods RR, D1, D2 and MPR.

Usage

psfmi_lm(
  data,
  formula = NULL,
  nimp = 5,
  impvar = NULL,
  Outcome = NULL,
  predictors = NULL,
  cat.predictors = NULL,
  spline.predictors = NULL,
  int.predictors = NULL,
  keep.predictors = NULL,
  nknots = NULL,
  p.crit = 1,
  method = "RR",
  direction = NULL
)

Arguments

data

Data frame with stacked multiple imputed datasets. The original dataset that contains missing values must be excluded from the dataset. The imputed datasets must be distinguished by an imputation variable, specified under impvar, and starting by 1.

formula

A formula object to specify the model as normally used by glm. See under "Details" and "Examples" how these can be specified. If a formula object is used set predictors, cat.predictors, spline.predictors or int.predictors at the default value of NULL.

nimp

A numerical scalar. Number of imputed datasets. Default is 5.

impvar

A character vector. Name of the variable that distinguishes the imputed datasets.

Outcome

Character vector containing the name of the continuous outcome variable.

predictors

Character vector with the names of the predictor variables. At least one predictor variable has to be defined. Give predictors unique names and do not use predictor name combinations with numbers as, age2, gender10, etc.

cat.predictors

A single string or a vector of strings to define the categorical variables. Default is NULL categorical predictors.

spline.predictors

A single string or a vector of strings to define the (restricted cubic) spline variables. Default is NULL spline predictors. See details.

int.predictors

A single string or a vector of strings with the names of the variables that form an interaction pair, separated by a “:” symbol.

keep.predictors

A single string or a vector of strings including the variables that are forced in the model during predictor selection. All type of variables are allowed.

nknots

A numerical vector that defines the number of knots for each spline predictor separately.

p.crit

A numerical scalar. P-value selection criterium. A value of 1 provides the pooled model without selection.

method

A character vector to indicate the pooling method for p-values to pool the total model or used during predictor selection. This can be "RR", D1", "D2", "D3" or "MPR". See details for more information. Default is "RR".

direction

The direction of predictor selection, "BW" means backward selection and "FW" means forward selection.

Details

The basic pooling procedure to derive pooled coefficients, standard errors, 95 confidence intervals and p-values is Rubin's Rules (RR). However, RR is only possible when the model included continuous or dichotomous variables. Specific procedures are available when the model also included categorical (> 2 categories) or restricted cubic spline variables. These pooling methods are: “D1” is pooling of the total covariance matrix, ”D2” is pooling of Chi-square values and “MPR” is pooling of median p-values (MPR rule). Spline regression coefficients are defined by using the rcs function for restricted cubic splines of the rms package. A minimum number of 3 knots as defined under knots is required.

A typical formula object has the form Outcome ~ terms. Categorical variables has to be defined as Outcome ~ factor(variable), restricted cubic spline variables as Outcome ~ rcs(variable, 3). Interaction terms can be defined as Outcome ~ variable1*variable2 or Outcome ~ variable1 + variable2 + variable1:variable2. All variables in the terms part have to be separated by a "+". If a formula object is used set predictors, cat.predictors, spline.predictors or int.predictors at the default value of NULL.

Value

An object of class pmods (multiply imputed models) from which the following objects can be extracted:

Author(s)

Martijn Heymans, 2021

References

Enders CK (2010). Applied missing data analysis. New York: The Guilford Press.

van de Wiel MA, Berkhof J, van Wieringen WN. Testing the prediction error difference between 2 predictors. Biostatistics. 2009;10:550-60.

Marshall A, Altman DG, Holder RL, Royston P. Combining estimates of interest in prognostic modelling studies after multiple imputation: current practice and guidelines. BMC Med Res Methodol. 2009;9:57.

Van Buuren S. (2018). Flexible Imputation of Missing Data. 2nd Edition. Chapman & Hall/CRC Interdisciplinary Statistics. Boca Raton.

EW. Steyerberg (2019). Clinical Prediction MOdels. A Practical Approach to Development, Validation, and Updating (2nd edition). Springer Nature Switzerland AG.

http://missingdatasolutions.rbind.io/

Examples

  pool_lm <- psfmi_lm(data=lbpmilr, formula = Pain ~ factor(Satisfaction) + 
  rcs(Tampascale,3) + Radiation + 
  Radiation*factor(Satisfaction) + Age + Duration + BMI,
  p.crit = 0.05, direction="FW", nimp=5, impvar="Impnr", 
  keep.predictors = c("Radiation*factor(Satisfaction)", "Age"), method="D1")
  
  pool_lm$RR_model_final


[Package psfmi version 1.4.0 Index]