calibrationBeltPoints {givitiR}R Documentation

Calibration Belt Confidence Region

Description

calibrationBeltPoints computes the points defining the boundary of the confidence region.

Usage

calibrationBeltPoints(data, seqG, m, fit, thres, cLevel, devel)

Arguments

data

A data.frame object with the numeric variables "o", "e" and "logite", representing the binary outcomes, the probabilities of the model under evaluation and the logit of the probabilities, respectively. The variable "e" must contain values between 0 and 1. The variable "o" must assume only the values 0 and 1.

seqG

A vector containing the logit of the probabilities where the points of the calibration belt will be evaluated.

m

A scalar integer representing the degree of the polynomial at the end of the forward selection.

fit

An object of class glm containig the output of the fit of the logistic regression model at the end of the iterative forward selection.

thres

A numeric scalar between 0 and 1 representing 1 - the significance level adopted in the forward selection.

cLevel

A numeric scalar between 0 and 1 representing the confidence level that will be used for the confidence region.

devel

A character string specifying if the model has been fit on the same dataset under evaluation (internal) or if the model has been developed on an external sample (external).

Value

A data.frame object with two columns, "U" and "L", containing the points of the upper and lower boundary of the cLevel*100%-level calibration belt evaluated at values seqG.

See Also

givitiCalibrationBelt and plot.givitiCalibrationBelt to compute and plot the calibaration belt, and givitiCalibrationTest to perform the associated calibration test.

Examples

e <- runif(100)
logite <- logit(e)
o <- rbinom(100, size = 1, prob = e)
data <- data.frame(e = e, o = o, logite = logite)

seqG <- logit(seq(from = .01, to =.99, by = .01))

fwLR <- polynomialLogRegrFw(data, .95, 4, 1)

calibrationBeltPoints(data, seqG, fwLR$m, fwLR$fit, .95, .90, "external")

[Package givitiR version 1.3 Index]