Skip to contents

At level two the quantity predicted is a group mean, whose residual variance is sigma2_u + sigma2_e / n rather than sigma2_u + sigma2_e: averaging over n members shrinks the level-1 noise by n but leaves the group-level term untouched. With n = 1 this coincides exactly with the level-1 measure, and as n grows it tends to 1 - sigma2_u1 / sigma2_u0.

Usage

Snr2u(sigma2_e1, sigma2_u1, sigma2_e0, sigma2_u0, n = 1)

Arguments

sigma2_e1

Level-1 residual variance of the fitted model.

sigma2_u1

Level-2 intercept variance of the fitted model.

sigma2_e0

Level-1 residual variance of the empty model.

sigma2_u0

Level-2 intercept variance of the empty model.

n

Group size; the harmonic mean of group sizes for unbalanced data. Must be positive.

Value

List with estimate, total1, total0, n, limit_large_n, reduction, method.

Details

Formula: R2_2 = 1 - (sigma2_e1/n + sigma2_u1) / (sigma2_e0/n + sigma2_u0).

References

Snijders, T. A. B. and Bosker, R. J. (1994). Modeled variance in two-level models. Sociological Methods and Research 22(3):342-363. doi:10.1177/0049124194022003004

Examples

Snr2u(1, 0.5, 4, 1, 20)
#> $estimate
#> [1] 0.5416667
#> 
#> $total1
#> [1] 0.55
#> 
#> $total0
#> [1] 1.2
#> 
#> $n
#> [1] 20
#> 
#> $limit_large_n
#> [1] 0.5
#> 
#> $reduction
#> [1] 0.65
#> 
#> $method
#> [1] "R2_2 = 1 - (s2_e1/n+s2_u1)/(s2_e0/n+s2_u0) [Snijders & Bosker 1994]"
#>