Skip to contents

Draw a forest plot of the performance of an internally-externally cross-validated model. By default the final model is shown.

Usage

# S3 method for metapred
forest(x, perfFUN = 1, step = NULL, method = "REML", model = NULL, ...)

Arguments

x

A metapred fit object

perfFUN

Numeric or character. Which performance statistic should be plotted? Defaults to the first.

step

Which step should be plotted? Defaults to the best step. numeric is converted to name of the step: 0 for an unchanged model, 1 for the first change...

method

character string specifying whether a fixed- or a random-effects model should be used to summarize the prediction model performance. A fixed-effects model is fitted when using method="FE". Random-effects models are fitted by setting method equal to one of the following: "DL", "HE", "SJ", "ML", "REML", "EB", "HS", or "GENQ". Default is "REML".

model

Which model change should be plotted? NULL (default, best change) or character name of variable or (integer) index of model change.

...

Other arguments passed to plotting internals. E.g. title. See forest.default for details.

Author

Valentijn de Jong <Valentijn.M.T.de.Jong@gmail.com>

Examples

data(DVTipd)

# Internal-external cross-validation of a pre-specified model 'f'
f <- dvt ~ histdvt + ddimdich + sex + notraum
fit <- metapred(DVTipd, strata = "study", formula = f, scope = f, family = binomial)

# Display the model's external performance (expressed as mean squared error by default) 
# for each study
forest(fit)
#> Error in forest.default(fit): Must specify either 'vi', 'sei', or ('ci.lb', 'ci.ub') pairs.