recalibrate: Recalibrate a Prediction Model

Description Usage Arguments Details Value Examples

View source: R/metapred_recal.R

Description

recalibrate is used to recalibrate a prediction model of classes metapred, glm or lm.

Usage

1
recalibrate(object, newdata, f = ~1, estFUN = NULL, ...)

Arguments

object

A model fit object to be recalibrated, of class metapred, glm or lm, and more.

newdata

data.frame containing new data set for updating.

f

formula. Which coefficients of the model should be updated? Default: intercept only. Left-hand side may be left out. See formula for details.

estFUN

Function for model estimation. If left NULL, the function is automatically retrieved for metapred objects. For other objects, the function with name corresponding to the first class of the object is taken. E.g. glm() for glm objects.

...

Optional arguments to pass to estFUN.

Details

Currently only the coefficients are updated and the variances and other aspects are left untouched. For updating the entire model and all its statistics, see update.

Value

Recalibrated model fit object, of the same class as object. Generally, updated coefficients can be retrieved with coef().

Examples

1
2
3
4
5
6
7
8
9
data(DVTipd)
DVTipd$cluster <- 1:4 # Add a fictional clustering to the data set.
# Suppose we estimated the model in three studies: 
DVTipd123 <- DVTipd[DVTipd$cluster <= 3, ]
mp <- metamisc:::metapred(DVTipd123, strata = "cluster", f = dvt ~ vein + malign, 
family = binomial)
# and now want to recalibrate it for the fourth:
DVTipd4 <- DVTipd[DVTipd$cluster == 4, ]
metamisc:::recalibrate(mp, newdata = DVTipd4)

metamisc documentation built on Oct. 13, 2021, 3 p.m.