givitiCalibrationTestComp {givitiR} | R Documentation |
Computation of the Calibration Test
Description
givitiCalibrationTestComp
implements the computations necessary to
perform the calibration test associated to the calibration belt.
Usage
givitiCalibrationTestComp(o, e, devel, thres, maxDeg)
Arguments
o |
A numeric vector representing the binary outcomes.
The elements must assume only the values 0 or 1. The predictions
in |
e |
A numeric vector containing the probabilities of the
model under evaluation. The elements must be numeric and between 0 and 1.
The lenght of the vector must be equal to the length of the vector |
devel |
A character string specifying if the model has been fit on
the same dataset under evaluation ( |
thres |
A numeric scalar between 0 and 1 representing 1 - the significance level adopted in the forward selection. |
maxDeg |
The maximum degree considered in the forward selection. |
Details
The calibration belt and the associated test can be used both to evaluate the calibration of the model in external samples or in the development dataset. However, the two cases have different requirements. When a model is evaluated on independent samples, the calibration belt and the related test can be applied whatever is the method used to fit the model. Conversely, they can be used on the development set only if the model is fitted with logistic regression.
Value
A list containing the following components:
- data
A
data.frame
object with the numeric variables "o", "e" provided in the input and the variable "logite", the logit of the probabilities.- nrowOrigData
The size of the original sample, i.e. the length of the vectors
e
ando
.- calibrationStat
The value of the test's statistic.
- calibrationP
The p-value of the test.
- m
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.
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)
o <- rbinom(100, size = 1, prob = e)
givitiCalibrationTestComp(o, e, "external", .95, 4)