Announcement

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

  • Loneway for reliability

    loneway calculates "reliability" calculated at a value of n per group. In this example, there are 496 ratings (PIP Total) from 57 groups (znum) or 8.7 ratings per group. Why does the output say "evaluated at n=8.35"?

    Many thanks,

    Ben

    Code:
                 One-way analysis of variance for pip_score: PIP Total
    
                                                 Number of obs =          496
                                                     R-squared =       0.2738
    
        Source                SS         df      MS            F     Prob > F
    -------------------------------------------------------------------------
    Between znum           40321.257     56    720.02245      2.96     0.0000
    Within znum            106959.69    439    243.64395
    -------------------------------------------------------------------------
    Total                  147280.95    495    297.53727
    
             Intraclass       Asy.        
             correlation      S.E.       [95% conf. interval]
             ------------------------------------------------
                0.18971     0.06230       0.06761     0.31181
    
             Estimated SD of znum effect             7.552705
             Estimated SD within znum                 15.6091
             Est. reliability of a znum mean          0.66162
                  (evaluated at n=8.35)

  • #2
    Code:
    Between-group variance: σ_between^2 ≈ (7.552705)^2 ≈ 57.09
    Within-group variance: σ_within^2 ≈ (15.6091)^2 ≈ 243.64
    Est. reliability: R = 0.66162
    ∵ R = σ_between^2 / (σ_between^2 + σ_within^2 / n) 
    0.66162 = 57.09 / (57.09 + 243.64 / n) 
    ∴ n ≈ 8.3–8.4

    Comment


    • #3
      Thanks, but I really meant why is it not the observed n of 8.7? How should I interpret this value of 8.35?

      Comment


      • #4
        Hi Ben Littenberg ,

        The observed average is indeed 496/57 = 8.70 ratings per group. The 8.35 in the output is the reference group size that loneway uses when the number of ratings varies across groups.

        For an unweighted analysis, the Stata manual calls this quantity g. Let n_i be the number of ratings in group i, N the total number of ratings, and k the number of groups (StataCorp 2025, pp. 5 and 7).

        Code:
        g = (N - sum(n_i^2)/N) / (k - 1)
        Equivalently, g is the arithmetic mean group size minus the sample variance of the group sizes divided by N. If all groups have the same number of ratings, that adjustment is zero. The more the counts vary across groups, the larger the adjustment. Gleason (1997, pp. 25–31) gives the background on how unequal group sizes enter the one-way random-effects ANOVA.

        You can recover g from the mean squares and the estimated between-group SD in your output.

        Code:
        display (720.02245 - 243.64395) / (7.552705^2)
        That gives 8.3512 using the displayed numbers. The reported 0.66162 is the model-based reliability of a group mean evaluated at that reference size. For a particular group, you can evaluate the same reliability formula at the actual number of ratings that went into its mean.

        References

        Gleason, J. R. 1997. Computing intraclass correlations and large ANOVAs. Stata Technical Bulletin 35: 25–31. Article PDF.

        StataCorp. 2025. loneway — Large one-way ANOVA, random effects, and reliability. In Stata 19 Base Reference Manual. College Station, TX, Stata Press. Methods and formulas.

        Comment


        • #5
          Aha! That's just what I needed - thanks.

          Comment

          Working...
          X