rejection {distfreereg}R Documentation

Compute Rejection Rates of a Distribution-Free Test

Description

Compute the rejection rates of the tests simulated in a compare object. Specifically, this function estimates the rejection rates of the tests conducted with specified statistics of the hypothesis that the mean function is test_mean when the true mean function is true_mean.

Usage

	rejection(object, alpha = 0.05, stat = names(object[["observed_stats"]]), ...)

Arguments

object

Object of class compare.

alpha

Numeric vector; specifies the \alpha-levels to use. Passed as probs argument to quantile.

stat

Character vector; specifies the names of the statistics to use. The default value computes the rejection rate associated with every statistic in object.

...

Additional arguments to pass to quantile to estimate the 1-\alpha quantiles of the distribution of simulated statistics.

Value

Data frame containing estimated rejection rates and associated Monte Carlo standard errors, with one row for each combination of stat and alpha elements.

Warning

The reported Monte Carlo standard error does not account for the uncertainty of the estimation of the 1-\alpha quantiles of the distribution of simulated statistics. The number of Monte Carlo simulations should be large enough to make this estimate sufficiently accurate that it can be considered known for practical purposes. The standard errors of estimated quantiles can be calculated using the mcmcse package.

Author(s)

Jesse Miller

See Also

distfreereg, compare

Examples

# In practice, set "reps" larger than 200.
set.seed(20240201)
n <- 100
func <- function(X, theta) theta[1] + theta[2]*X
Sig <- rWishart(1, df = n, Sigma = diag(n))[,,1]
theta <- c(2,5)
X <- matrix(rexp(n, rate = 1))
cdfr <- compare(true_mean = func, true_X = X, true_covariance = list(Sigma = Sig),
                test_mean = func, X = X, covariance = list(Sigma = Sig), reps = 200,
                prog = Inf, theta = theta, theta_init = rep(1, length(theta)))

rejection(cdfr)
rejection(cdfr, stat = "CvM")
rejection(cdfr, alpha = c(0.1, 0.2))

[Package distfreereg version 1.0.1 Index]