wp.anova.binary: Statistical Power Analysis for One-way ANOVA with Binary Data

Description Usage Arguments Value References Examples

View source: R/webpower.R

Description

The power analysis procedure for one-way ANOVA with binary data is introduced by Mai and Zhang (2017). One-way ANOVA with binary data is used for comparing means of three or more groups of binary data. Its outcome variable is supposed to follow Bernoulli distribution. And its overall test uses a likelihood ratio test statistics.

Usage

1
2
wp.anova.binary(k = NULL, n = NULL, V = NULL, alpha = 0.05,
  power = NULL)

Arguments

k

Number of groups.

n

Sample size.

V

Effect size. See the research by Mai and Zhang (2017) for details.

alpha

Significance level chosed for the test. It equals 0.05 by default.

power

Statistical power.

Value

An object of the power analysis.

References

Mai, Y., & Zhang, Z. (2017). Statistical Power Analysis for Comparing Means with Binary or Count Data Based on Analogous ANOVA. In L. A. van der Ark, M. Wiberg, S. A. Culpepper, J. A. Douglas, & W.-C. Wang (Eds.), Quantitative Psychology - The 81st Annual Meeting of the Psychometric Society, Asheville, North Carolina, 2016: Springer.

Zhang, Z., & Yuan, K.-H. (2018). Practical Statistical Power Analysis Using Webpower and R (Eds). Granger, IN: ISDSA Press.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#To calculate the statistical power for one-way ANOVA (overall test) with binary data:
wp.anova.binary(k=4,n=100,V=0.15,alpha=0.05)
#  One-way Analogous ANOVA with Binary Data
#
#    k   n    V alpha     power
#    4 100 0.15  0.05 0.5723443
#
#  NOTE: n is the total sample size
#  URL: http://psychstat.org/anovabinary

#To generate a power curve given a sequence of sample sizes:
res <- wp.anova.binary(k=4,n=seq(100,200,10),V=0.15,alpha=0.05,power=NULL)
res
#  One-way Analogous ANOVA with Binary Data
#
#    k   n    V alpha     power
#    4 100 0.15  0.05 0.5723443
#    4 110 0.15  0.05 0.6179014
#    4 120 0.15  0.05 0.6601594
#    4 130 0.15  0.05 0.6990429
#    4 140 0.15  0.05 0.7345606
#    4 150 0.15  0.05 0.7667880
#    4 160 0.15  0.05 0.7958511
#    4 170 0.15  0.05 0.8219126
#    4 180 0.15  0.05 0.8451603
#    4 190 0.15  0.05 0.8657970
#    4 200 0.15  0.05 0.8840327
#
#  NOTE: n is the total sample size
#  URL: http://psychstat.org/anovabinary

#To plot the power curve:
plot(res) 

#To calculate the required sample size for one-way ANOVA (overall test) with binary data:
wp.anova.binary(k=4,n=NULL,V=0.15,power=0.8, alpha=0.05)
#  One-way Analogous ANOVA with Binary Data
#
#    k        n    V alpha power
#    4 161.5195 0.15  0.05   0.8
#
#  NOTE: n is the total sample size
#  URL: http://psychstat.org/anovabinary

#To calculate the minimum detectable effect size for one-way ANOVA (overall test) with binary data:
wp.anova.binary(k=4,n=100,V=NULL,power=0.8, alpha=0.05)
#  One-way Analogous ANOVA with Binary Data
#
#    k   n         V alpha power
#    4 100 0.1906373  0.05   0.8
#
#  NOTE: n is the total sample size
#  URL: http://psychstat.org/anovabinary

#To generate a power curve given a sequence of effect sizes:
wp.anova.binary(k=4,n=100,V=seq(0.1,0.5,0.05),alpha=0.05,power=NULL)
#  One-way Analogous ANOVA with Binary Data
#
#    k   n    V alpha     power
#    4 100 0.10  0.05 0.2746396
#    4 100 0.15  0.05 0.5723443
#    4 100 0.20  0.05 0.8402271
#    4 100 0.25  0.05 0.9659434
#    4 100 0.30  0.05 0.9961203
#    4 100 0.35  0.05 0.9997729
#    4 100 0.40  0.05 0.9999933
#    4 100 0.45  0.05 0.9999999
#    4 100 0.50  0.05 1.0000000
#
#  NOTE: n is the total sample size
#  URL: http://psychstat.org/anovabinary

Example output

Loading required package: MASS
Loading required package: lme4
Loading required package: Matrix
Loading required package: lavaan
This is lavaan 0.6-7
lavaan is BETA software! Please report any bugs.
Loading required package: parallel
Loading required package: PearsonDS
One-way Analogous ANOVA with Binary Data

    k   n    V alpha     power
    4 100 0.15  0.05 0.5723443

NOTE: n is the total sample size
URL: http://psychstat.org/anovabinary
One-way Analogous ANOVA with Binary Data

    k   n    V alpha     power
    4 100 0.15  0.05 0.5723443
    4 110 0.15  0.05 0.6179014
    4 120 0.15  0.05 0.6601594
    4 130 0.15  0.05 0.6990429
    4 140 0.15  0.05 0.7345606
    4 150 0.15  0.05 0.7667880
    4 160 0.15  0.05 0.7958511
    4 170 0.15  0.05 0.8219126
    4 180 0.15  0.05 0.8451603
    4 190 0.15  0.05 0.8657970
    4 200 0.15  0.05 0.8840327

NOTE: n is the total sample size
URL: http://psychstat.org/anovabinary
One-way Analogous ANOVA with Binary Data

    k        n    V alpha power
    4 161.5195 0.15  0.05   0.8

NOTE: n is the total sample size
URL: http://psychstat.org/anovabinary
One-way Analogous ANOVA with Binary Data

    k   n         V alpha power
    4 100 0.1906373  0.05   0.8

NOTE: n is the total sample size
URL: http://psychstat.org/anovabinary
One-way Analogous ANOVA with Binary Data

    k   n    V alpha     power
    4 100 0.10  0.05 0.2746396
    4 100 0.15  0.05 0.5723443
    4 100 0.20  0.05 0.8402271
    4 100 0.25  0.05 0.9659434
    4 100 0.30  0.05 0.9961203
    4 100 0.35  0.05 0.9997729
    4 100 0.40  0.05 0.9999933
    4 100 0.45  0.05 0.9999999
    4 100 0.50  0.05 1.0000000

NOTE: n is the total sample size
URL: http://psychstat.org/anovabinary

WebPower documentation built on May 1, 2019, 8:19 p.m.