predictStatusProb: Probability Predictions

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Function to extract probabilistic event status predictions from various diagnostic and prognostic models with binary status response. The function has a speficic method depending on the 'class' of the object.

Usage

1
2
## S3 method for class 'glm'
predictStatusProb(object,newdata,...)

Arguments

object

A model from which predicted probabilities can be extracted for the indiviuals in newdata.

newdata

A data frame containing data for which the object can provide predict probabilities. In medical applications newdata will typically consist of the data of patients whose data were not used for building the model.

...

Additional arguments that are passed on to the current method.

Details

The function delivers predicted probabilities tailored for the model performance measures of the package. These probabilities are extracted from a fitted model of class CLASS with the function predictStatusProb.CLASS. See help(Roc) for details.

Value

A vector with the predicted status probability for each row in NROW(newdata).

Note

It is rather easy to write a new predictStatusProb method, see help(Roc). However, if you do not succeed, please send me an email.

The performance, in particular when doing cross-validation where the model is evaluated many times, can be improved by supressing in the call to the model all the computations that are not needed for probability prediction, for example standard error calculations.

Author(s)

Thomas A. Gerds tag@biostat.ku.dk

See Also

predict,Roc

Examples

1
2
3
4
5
6
7
library(rms)
set.seed(7)
x <- abs(rnorm(20))
d <- data.frame(y=rbinom(20,1,x/max(x)),x=x,z=rnorm(20))
nd <- data.frame(y=rbinom(8,1,x/max(x)),x=abs(rnorm(8)),z=rnorm(8))
fit <- lrm(y~x+z,d)
predictStatusProb(fit,newdata=nd)

ModelGood documentation built on May 2, 2019, 5 p.m.