Description Usage Arguments Details Value Examples
View source: R/pwr_chisq_test_association.R
pwr_chisq_test_association
computes the power and the sample size
for the chi squared testing to check association between two qualitative
variables.
1 2 | pwr_chisq_test_association(es, nrow, ncol, n = NULL, pwr = NULL,
sig_level = 0.05)
|
es |
effect size |
nrow |
number of categories of the first variable |
ncol |
number of categories of the second variable |
n |
number of observations (sample size) |
pwr |
power of test 1 + β (1 minus type II error probability) |
sig_level |
significance level (Type I error probability) |
In this function, we use the effect size es
=√{\frac{χ_{obs}^2}{n}}, where n is the sample size and
χ^2_{obs} is the statistics test. es
is a coefficient or
measure of association.
The effect size es
=w=√{\frac{w^2}{n}} is an strength measure
of association. Usually, we use
w=0.1
to detect a weak association between two variables
w=0.3
to detect a moderate association between two variables
w=0.5
to detect a strong association between two variables
pwr_chisq_test_association
returns a list with the following
components:
effect size
number of categories of the first variable
number of categories of the second variable
significance level
A tibble
with sample size and n
is the number of pairs
1 2 3 4 5 6 | # Power
pwr_chisq_test_association(es = 0.5, nrow = 5, ncol = 5,
n = 300, pwr = NULL, sig_level = 0.05)
# Sample size
pwr_chisq_test_association(es = 0.5, nrow = 5, ncol = 5,
n = NULL, pwr = 0.99, sig_level = 0.05)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.