Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Suggestion #14 can be done in Stata using -chitest- (from SSC) as follows:
    Code:
    /* Example Johnston et al. (2006, p. 414)
    
       Johnston, J.E., Berry, K.J. & Mielke Jr, P.W. (2006). Measures of effect size
          for chi-squared and likelihood-ratio goodness-of-fit tests. Perceptual and
          Motor Skills, 103(2), 412--414.
    */
    
    clear
    input obs exp
      24  8
       8 10
       6 10
       2 12
    end
    
    sum exp, meanonly
    local q = r(min)/r(sum)
    local n = r(sum)
    chitest obs exp
    di _n as txt "Effect size    (Chi²) = " as res %5.4f r(chi2)/(`n'*(1-`q')/`q') _n ///
       as txt "Effect size (LR-Chi²) = " as res %5.4f r(chi2_lr)/(-2*`n'*ln(`q'))
    The result is:
    Code:
    . chitest obs exp
    
    observed frequencies from obs; expected frequencies from exp
    
             Pearson chi2(3) =  42.3333   Pr =  0.000
    likelihood-ratio chi2(3) =  35.8661   Pr =  0.000
    
      +-------------------------------------------+
      | observed   expected   obs - exp   Pearson |
      |-------------------------------------------|
      |       24      8.000      16.000     5.657 |
      |        8     10.000      -2.000    -0.632 |
      |        6     10.000      -4.000    -1.265 |
      |        2     12.000     -10.000    -2.887 |
      +-------------------------------------------+
    
    . di _n as txt "Effect size    (Chi²) = " as res %5.4f r(chi2)/(`n'*(1-`q')/`q') _n ///
    >    as txt "Effect size (LR-Chi²) = " as res %5.4f r(chi2_lr)/(-2*`n'*ln(`q'))
    
    Effect size    (Chi²) = 0.2646
    Effect size (LR-Chi²) = 0.2786
    Note the close relationship of the effect size for Chi² to Cramérs V. It would be nice if the effect size calculations could also be implemented in -chitest-.
    Last edited by Dirk Enzmann; 29 May 2021, 09:29. Reason: corrected reference to #14

    Comment

    Working...
    X