metapred {metamisc} | R Documentation |
Generalized stepwise regression for obtaining a prediction model with adequate performance across data sets. Requires data from individuals in multiple studies.
metapred(data, strata, formula = NULL, estFUN = "glm", stepwise = TRUE, center.out = FALSE, center.cov = FALSE, recal.int = FALSE, cvFUN = NULL, cv.k = NULL, metaFUN = NULL, meta.method = "REML", predFUN = NULL, perfFUN = NULL, genFUN = NULL, selFUN = "which.min", ...)
data |
data.frame containing the datasets. |
strata |
Name of the strata (e.g. studies or clusters) variable, as character. Used for two-stage MA only. |
formula |
Formula of the full model to be evaluated, and possibly reduced. If not supplied,
it is assumed the first column in the data set is the outcome, and all remaining columns
(except |
estFUN |
Function for estimating the model in the first stage. Currently "lm" and "glm" are supported. |
stepwise |
Logical. Should stepwise selection be performed? |
center.out |
Logical. Should the outcome be centered within studies? |
center.cov |
Logical. Should covariates be centered within studies? |
recal.int |
Logical. Should the intercept be recalibrated? |
cvFUN |
Cross-validation method, on the study (i.e. cluster or stratum) level. " l1o" for leave-one-out cross-validation (default). "bootstrap" for bootstrap. Or "fixed", for one or more data sets which are only used for validation. A user written function may be supplied as well. |
cv.k |
Parameter for cvFUN. For |
metaFUN |
Function for computing the meta-analytic coefficient estimates in two-stage MA. Default: rma
from the metafor package is used. Default settings are univariate random effects, estimated with "REML". Method can be
passed trough the |
meta.method |
Name of method for meta-analysis. Default is "REML". For more options see rma. |
predFUN |
Function for predicting new values. Defaults to the appropriate link functions for two-stage MA where
|
perfFUN |
Function for computing the performance of the prediction models. Default: mean squared error ( |
genFUN |
Function computing generalizability measure using the performance measures. Default: (absolute) mean
( |
selFUN |
Function for selecting the best method. Default: lowest value for |
... |
To pass arguments to estFUN (e.g. family = "binomial"), or other methods. |
metapred
A list of class metapred
, containing the final coefficients in coefficients
, and the stepwise
tree of estimates of the coefficients (coef)
, performance measures (perf)
, generalizability measures
(gen)
in stepwise
, and more.
Valentijn de Jong
Debray TPA, Moons KGM, Ahmed I, Koffijberg H, Riley RD. A framework for developing, implementing, and evaluating clinical prediction models in an individual participant data meta-analysis. Stat Med. 2013;32(18):3158-80.
data(DVTipd) DVTipd$cluster <- 1:4 # Add a fictional clustering to the data set. metamisc:::metapred(DVTipd, strata = "cluster", f = dvt ~ sex + vein + malign, family = binomial) ## Not run: # Some additional examples: metamisc:::metapred(DVTipd, strata = "cluster", f = dvt ~ sex + vein + malign , family = binomial, stepwise = FALSE) metamisc:::metapred(DVTipd, strata = "cluster", f = dvt ~ sex + altdiagn + histdvt , family = binomial, recal.int = TRUE) metamisc:::metapred(DVTipd, strata = "cluster", f = dvt ~ sex + altdiagn + histdvt , family = binomial, meta.method = "DL") ## End(Not run) # By default, metapred assumes the first column is the outcome. DVTipd.reordered <- DVTipd[c("dvt", "ddimdich", "histdvt", "cluster")] mp <- metamisc:::metapred(DVTipd.reordered, strata = "cluster", family = binomial) fitted <- predict(mp, newdata = DVTipd.reordered)