calibrationBeltPoints: Calibration Belt Confidence Region

Description Usage Arguments Value See Also Examples

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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")

Example output

              L          U
1  0.0002278660 0.03004837
2  0.0007923149 0.05048065
3  0.0016560862 0.06829303
4  0.0028012058 0.08461876
5  0.0042219160 0.09991921
6  0.0059154295 0.11445475
7  0.0078810280 0.12839154
8  0.0101192495 0.14184444
9  0.0126314178 0.15489752
10 0.0154193434 0.16761497
11 0.0184851156 0.18004747
12 0.0218309500 0.19223611
13 0.0254590676 0.20421497
14 0.0293715974 0.21601289
15 0.0335704925 0.22765460
16 0.0380574562 0.23916170
17 0.0428338767 0.25055322
18 0.0479007655 0.26184619
19 0.0532587030 0.27305592
20 0.0589077859 0.28419639
21 0.0648475793 0.29528037
22 0.0710770724 0.30631969
23 0.0775946380 0.31732531
24 0.0843979961 0.32830747
25 0.0914841814 0.33927578
26 0.0988495170 0.35023922
27 0.1064895915 0.36120629
28 0.1143992442 0.37218495
29 0.1225725539 0.38318271
30 0.1310028388 0.39420659
31 0.1396826591 0.40526314
32 0.1486038317 0.41635844
33 0.1577574507 0.42749805
34 0.1671339172 0.43868702
35 0.1767229792 0.44992983
36 0.1865137802 0.46123035
37 0.1964949145 0.47259183
38 0.2066544958 0.48401679
39 0.2169802301 0.49550703
40 0.2274594991 0.50706356
41 0.2380794508 0.51868652
42 0.2488270952 0.53037516
43 0.2596894049 0.54212779
44 0.2706534224 0.55394173
45 0.2817063666 0.56581329
46 0.2928357413 0.57773770
47 0.3040294403 0.58970918
48 0.3152758544 0.60172083
49 0.3265639679 0.61376472
50 0.3378834510 0.62583187
51 0.3492247415 0.63791229
52 0.3605791184 0.64999502
53 0.3719387611 0.66206821
54 0.3832967975 0.67411917
55 0.3946473371 0.68613446
56 0.4059854919 0.69810001
57 0.4173073816 0.71000118
58 0.4286101286 0.72182291
59 0.4398918402 0.73354983
60 0.4511515802 0.74516635
61 0.4623893328 0.75665683
62 0.4736059601 0.76800565
63 0.4848031564 0.77919736
64 0.4959833990 0.79021680
65 0.5071499002 0.80104917
66 0.5183065597 0.81168014
67 0.5294579221 0.82209597
68 0.5406091366 0.83228355
69 0.5517659295 0.84223047
70 0.5629345741 0.85192511
71 0.5741218794 0.86135666
72 0.5853351791 0.87051516
73 0.5965823377 0.87936622
74 0.6078717640 0.88805083
75 0.6192124374 0.89626696
76 0.6306139489 0.90423177
77 0.6420865559 0.91198163
78 0.6536412552 0.91928673
79 0.6652898767 0.92631459
80 0.6770452014 0.93309305
81 0.6889211090 0.93944974
82 0.7009327605 0.94551249
83 0.7130968324 0.95130275
84 0.7254318030 0.95669449
85 0.7379583262 0.96178350
86 0.7506997043 0.96658636
87 0.7636825073 0.97101360
88 0.7769373950 0.97514114
89 0.7905002267 0.97894909
90 0.8044136000 0.98243934
91 0.8187290410 0.98561403
92 0.8335102289 0.98847520
93 0.8488379440 0.99102463
94 0.8648180494 0.99326362
95 0.8815952292 0.99519261
96 0.8993787616 0.99681068
97 0.9184970502 0.99811460
98 0.9395363251 0.99909696
99 0.9638321085 0.99974141

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