as.reliabilitydiag {reliabilitydiag}R Documentation

Coerce to a reliability diagram

Description

Coerce numeric vectors, data frames, or anything else that can be coerced by as.data.frame to a data frame of prediction values, into an object inheriting from the 'reliabilitydiag' class.

Usage

as.reliabilitydiag(x, ...)

is.reliabilitydiag(x)

## S3 method for class 'reliabilitydiag'
as.reliabilitydiag(x, y = NULL, r = NULL, tol = sqrt(.Machine$double.eps), ...)

## Default S3 method:
as.reliabilitydiag(
  x,
  y = NULL,
  r = NULL,
  xtype = NULL,
  xvalues = NULL,
  .name_repair = "unique",
  region.level = 0.9,
  region.method = NULL,
  region.position = "diagonal",
  n.boot = 100,
  ...
)

## S3 method for class 'data.frame'
as.reliabilitydiag(
  x,
  y = NULL,
  r = NULL,
  xtype = NULL,
  xvalues = NULL,
  .name_repair = "unique",
  region.level = 0.9,
  region.method = NULL,
  region.position = "diagonal",
  n.boot = 100,
  ...
)

Arguments

x

an R object with probability predictions taking values in [0, 1]; usually a numeric vector or a list/data.frame containing numeric vectors.

...

further arguments to be passed to or from methods.

y

a numeric vector of binary response values in {0, 1} to be predicted.

r

an object inheriting from the class 'reliabilitydiag'; alternative to y.

tol

accuracy when comparing y in 'reliabilitydiag' objects.

xtype

a string specifying whether the prediction values should be treated as "continuous" or "discrete".

xvalues

a numeric vector of possible prediction values; values in x are rounded to the nearest value in xvalues and xtype is set to "discrete".

.name_repair

This argument is passed on as repair to vec_as_names. See there for more details.

region.level

a value in (0, 1) specifying the level at which consistency or confidence regions are calculated.

region.method

a string specifying whether "resampling", "continuous_asymptotics", or "discrete_asymptotics" are used to calculate consistency/confidence regions.

region.position

a string specifying whether consistency regions around the "diagonal" or confidence regions around the "estimate" are calculated.

n.boot

the number of bootstrap samples when region.method == "resampling".

Value

as.reliabilitydiag returns a 'reliabilitydiag' object.

is.reliabilitydiag returns TRUE if its argument is a reliability diagram, that is, has "reliabilitydiag" among its classes, and FALSE otherwise.

See Also

reliabilitydiag


[Package reliabilitydiag version 0.2.1 Index]