plot.givitiCalibrationBelt: Calibration Belt Plot

Description Usage Arguments Value See Also Examples

Description

The plot method for calibration belt objects.

Usage

1
2
3
4
5
6
## S3 method for class 'givitiCalibrationBelt'
plot(x, xlim = c(0, 1), ylim = c(0, 1),
  colBis = "red", xlab = "e", ylab = "o",
  main = "GiViTI Calibration Belt", polynomialString = T,
  pvalueString = T, nString = T, table = T, tableStrings = NULL,
  unableToFitString = NULL, ...)

Arguments

x

A givitiCalibrationBelt object, to be generated with the function givitiCalibrationBelt.

xlim,ylim

Numeric vectors of length 2, giving the x and y coordinates ranges. Default values are c(0,1).

colBis

The color to be used for the bisector. The default value is red.

xlab,ylab

Titles for the x and y axis. Default values are "e" and "o", repectively.

main

The main title of the plot. The default value is "GiViTI Calibration Belt".

polynomialString

If the value is FALSE, the degree of the polynomial is not printed on the graphical area. If the value is TRUE, the degree m is reported. If a string is passed to this argument, the string is reported instead of the text "Polynomial degree". The default value is TRUE.

pvalueString

If the value is FALSE, the p-value of the test is not printed on the graphical area. If the value is TRUE, the p-value is reported. If a string is passed to this argument, the string is reported instead of the text "p-value". The default value is TRUE.

nString

If the value is FALSE, the sample size is not printed on the graphical area. If the value is TRUE, the sample size is reported. If a string is passed to this argument, the string is reported instead of the text "n". The default value is TRUE.

table

A boolean value indicating whether the table reporting the intersections of the calibration belt with the bisector should be printed on the plot.

tableStrings

Optional. A list with four character elements named overBisString,underBisString,confLevelString, neverString. The four strings of the list are printed instead of the texts "Over the bisector"/"Under the bisector"/"Confidence level"/"NEVER" in the table reporting the intersections of the calibration belt with the bisector.

unableToFitString

Optional. If a string is passed to this argument, this string is reported in the plot area when the dataset is not compatible with the fit of the calibration belt (e.g. data separation or no positive events). By default, in such cases the text "Unable to fit the Calibration Belt" is reported.

...

Other graphical parameters passed to the generic plot method.

Value

The function generates the calibration belt plot. In addition, a list containing the following components is returned:

p.value

The p-value of the test.

m

The degree of the polynomial at the end of the forward selection.

See Also

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

Examples

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

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

Example output

$m
[1] 1

$p.value
[1] 0.5548919

$m
[1] 1

$p.value
[1] 6.156502e-09

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