get_p_classification: get_p_classification

View source: R/get_p_classification.R

get_p_classificationR Documentation

get_p_classification

Description

Calculate the p-value in Definition 21 of \insertCiteMRCS2023;textualISS.

Usage

get_p_classification(X, y, x0, tau)

Arguments

X

a numeric matrix specifying the covariates.

y

a numeric vector with length(y) == nrow(X) and all((y >= 0) & (y <= 1)) specifying the responses.

x0

a numeric vector specifying the point of interest, such that length(x0) == ncol(X).

tau

a single numeric value in [0,1) specifying the threshold of interest.

Value

A single numeric value in (0, 1].

References

\insertRef

MRCS2023ISS

Examples

set.seed(123)
n <- 100
d <- 2
X <- matrix(runif(d * n), ncol = d)
eta <- function(x) sum(x)
X_eta <- apply(X, MARGIN = 1, FUN = function(x) 1 / (1 + exp(-eta(x))))
y <- as.numeric(runif(n) < X_eta)
get_p_classification(X, y, x0 = c(1, 1), tau = 0.6)
get_p_classification(X, y, x0 = c(1, 1), tau = 0.9)

ISS documentation built on July 9, 2023, 5:13 p.m.