ES.chisq.assoc: Compute effect size of chi-squared test of association

Description Usage Arguments See Also Examples

View source: R/ES.chisq.assoc.R

Description

Compute effect size of chi-squared test of association

Usage

1
2
ES.chisq.assoc(ct = NULL, chisq = NULL, p = NULL, n = NULL, df = NULL,
  mindf = NULL)

Arguments

ct

a m x n Contingency Table (matrix with m rows and n columes)

chisq

the value the chi-squared test statistic

p

p value for the chi-squared test

n

total number of observations (sample size)

df

degree of freedom (e.g., df=(m-1)*(n-1))

mindf

the degrees of freedom for the variable with the smaller number of levels, if m > n, mindf=n-1, otherwise, mindf=m-1

See Also

ES.chisq.gof

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
counts <- matrix(c(225,125,85,95),nrow=2,byrow=TRUE)
ES.chisq.assoc(ct=counts)

case <- c(225,85,100)
control <- c(125,95,125)
counts <- cbind(case,control)
ES.chisq.assoc(ct=counts)

p1 <- c(225,85,100)
p2 <- c(125,95,125)
p3 <- c(175,90,113)
counts <- cbind(p1,p2,p3)
ES.chisq.assoc(ct=counts)

ES.chisq.assoc(chisq=13.561,n=530,df=1,mindf=1)

ES.chisq.assoc(p=0.000231,n=530,df=1,mindf=1)

Example output

     effect size of chi-squared test of association 

            phi = 0.159958
          chisq = 13.56088
              p = 0.000230949
              n = 530
             df = 1
          mindf = 1

NOTE: small effect size:  phi = 0.1
      medium effect size: phi = 0.3
      large effect size:  phi = 0.5


     effect size of chi-squared test of association 

            phi = 0.1873665
          chisq = 26.50519
              p = 1.755784e-06
              n = 755
             df = 2
          mindf = 1

NOTE: small effect size:  phi = 0.1
      medium effect size: phi = 0.3
      large effect size:  phi = 0.5


     effect size of chi-squared test of association 

            phi = 0.1081516
          chisq = 26.50488
              p = 2.502804e-05
              n = 1133
             df = 4
          mindf = 2

NOTE: small effect size:  phi = 0.14142135623731
      medium effect size: phi = 0.424264068711929
      large effect size:  phi = 0.707106781186548


     effect size of chi-squared test of association 

            phi = 0.1599587
          chisq = 13.561
              p = 0.000230934
              n = 530
             df = 1
          mindf = 1

NOTE: small effect size:  phi = 0.1
      medium effect size: phi = 0.3
      large effect size:  phi = 0.5


     effect size of chi-squared test of association 

            phi = 0.1599556
          chisq = 13.56046
              p = 0.000231
              n = 530
             df = 1
          mindf = 1

NOTE: small effect size:  phi = 0.1
      medium effect size: phi = 0.3
      large effect size:  phi = 0.5

powerAnalysis documentation built on May 2, 2019, 12:40 p.m.