givitiCalibrationTest: Calibration Test

Description Usage Arguments Details Value See Also Examples

Description

givitiCalibrationTest performs the calibration test associated to the calibration belt.

Usage

1
2
givitiCalibrationTest(o, e, devel, subset = NULL, thres = 0.95,
  maxDeg = 4)

Arguments

o

A numeric vector representing the binary outcomes. The elements must assume only the values 0 or 1. The predictions in e must represent the probability of the event coded as 1.

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 o.

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). See also the 'Details' section.

subset

An optional boolean vector specifying the subset of observations to be considered.

thres

A numeric scalar between 0 and 1 representing 1 - the significance level adopted in the forward selection. By default is set to 0.95.

maxDeg

The maximum degree considered in the forward selection. By default is set to 4.

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 of class htest containing the following components:

statistic

The value of the test's statistic.

p.value

The p-value of the test.

null.value

The vector of coefficients hypothesized under the null hypothesis, that is, the parameters corresponding to the bisector.

alternative

A character string describing the alternative hypothesis.

method

A character string indicating what type of calibration test (internal or external) was performed.

estimate

The estimate of the coefficients of the polynomial logistic regression.

data.name

A character string giving the name(s) of the data.

See Also

givitiCalibrationBelt and plot.givitiCalibrationBelt to compute and plot the calibaration belt.

Examples

1
2
3
4
5
6
7
8
9
#Random by-construction well calibrated model
e <- runif(100)
o <- rbinom(100, size = 1, prob = e)
givitiCalibrationTest(o, e, "external")

#Random by-construction poorly calibrated model
e <- runif(100)
o <- rbinom(100, size = 1, prob = logistic(logit(e)+2))
givitiCalibrationTest(o, e, "external")

Example output

	GiViTI calibration test - external validation

data:  e = 'Predictions' and o = 'Binary outcome'
Stat = 0.91641, p-value = 0.6324
alternative hypothesis: two.sided
null values:
beta0 beta1 
    0     1 
sample estimates:
      beta0       beta1 
-0.06316616  1.23200603 


	GiViTI calibration test - external validation

data:  e = 'Predictions' and o = 'Binary outcome'
Stat = 31.42, p-value = 1.504e-07
alternative hypothesis: two.sided
null values:
beta0 beta1 
    0     1 
sample estimates:
   beta0    beta1 
1.675654 1.253293 

givitiR documentation built on May 2, 2019, 10:58 a.m.