p_var.test | R Documentation |
Generates one or or more sets of continuous data group-level data
to perform a variance test, and return a p-value. When two-samples
are investigated the var.test
function will be used,
otherwise functions from the EnvStats
package will be used.
p_var.test(
n,
vars,
n.ratios = rep(1, length(vars)),
sigma2 = 1,
two.tailed = TRUE,
test = "Levene",
correct = TRUE,
gen_fun = gen_var.test,
...
)
gen_var.test(n, vars, n.ratios = rep(1, length(vars)), ...)
n |
sample size per group, assumed equal across groups |
vars |
a vector of variances to use for each group; length of 1 for one-sample tests |
n.ratios |
allocation ratios reflecting the sample size ratios. Default of 1 sets the groups to be the same size (n * n.ratio) |
sigma2 |
population variance to test against in one-sample test |
two.tailed |
logical; should a two-tailed or one-tailed test be used? |
test |
type of test to use in multi-sample applications.
Can be either |
correct |
logical; use correction when |
gen_fun |
function used to generate the required discrete data.
Object returned must be a |
... |
additional arguments to be passed to |
a single p-value
Phil Chalmers rphilip.chalmers@gmail.com
gen_var.test
# one sample
p_var.test(100, vars=10, sigma2=9)
# three sample
p_var.test(100, vars=c(10, 9, 11))
p_var.test(100, vars=c(10, 9, 11), test = 'Fligner')
p_var.test(100, vars=c(10, 9, 11), test = 'Bartlett')
# power to detect three-group variance differences
p_var.test(n=100, vars=c(10,9,11)) |> Spower()
# sample size per group to achieve 80% power
p_var.test(n=NA, vars=c(10,9,11)) |>
Spower(power=.80, interval=c(100, 1000))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.