| chi_power | R Documentation |
This function finds the power of various chi-square tests.
chi_power(
pnull,
ralt,
param_alt,
phat = function(x) -99,
alpha = 0.05,
Ranges = matrix(c(-Inf, Inf, -Inf, Inf), 2, 2),
nbins = c(5, 5),
rate = 0,
minexpcount = 5,
dnull = function(x) -99,
Retry = TRUE,
SuppressMessages = TRUE,
B = 1000
)
pnull |
distribution function to find cdf under null hypothesis |
ralt |
function to generate data under alternative hypothesis |
param_alt |
vector of parameter values for distribution under alternative hypothesis |
phat |
=function(x) -99, function to estimate parameters |
alpha |
=0.05, the level of the hypothesis test |
Ranges |
=matrix(c(-Inf, Inf, -Inf, Inf),2,2), a 2x2 matrix with lower and upper bounds, if any |
nbins |
=c(5, 5), number of bins for chi square tests |
rate |
=0 rate of Poisson if sample size is random, 0 if sample size is fixed |
minexpcount |
=5 minimal expected bin count required |
dnull |
=function(x) -99, density function to find probabilities under null hypothesis, mostly used for discrete data, or -99 if missing. |
Retry |
=TRUE, retry if test fails? |
SuppressMessages |
=TRUE, should info be shown? |
B |
=1000 number of simulation runs to find power |
A numeric matrix of power values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.