Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anova_table: implement SE calculation for different sample sizes #22

Open
wleoncio opened this issue Nov 10, 2020 · 2 comments
Open

anova_table: implement SE calculation for different sample sizes #22

wleoncio opened this issue Nov 10, 2020 · 2 comments

Comments

@wleoncio
Copy link
Collaborator

Summary

According to the following code, the anova_table() function is not able to calculate the standard error of the intraclass correlation when the sample sizes are different.

lsasim/R/anova_table.R

Lines 39 to 44 in 844c889

if (stats::var(ds$n_j) == 0) {
se_rho <- calc_se_rho(rho_hat, ds$n_j, ds$N)
} else {
se_rho <- NA
warning("SE not yet implemented for different sample sizes")
}

Theoretical references must be provided to implement this.

MRE

The following was performed on lsasim 2.0.2.9004.

remotes::install_github("tmatta/lsasim", "844c889a")
library(lsasim)
set.seed(12334)
n7 <- list(school = 10, student = ranges(10, 50))
r5 <- cluster_gen(n7, rho = c(0.005, 0.01, 0.85))
anova_table(r5)
@wleoncio
Copy link
Collaborator Author

@mollyolaf, @Kondwani84, @ylinglw, do any of you know where I could find the equation to calculate the standard error of rho (the intraclass correlation) when each sampling unit has a different size?

@wleoncio wleoncio mentioned this issue Dec 10, 2020
2 tasks
@wleoncio
Copy link
Collaborator Author

Reference: Donner (1986), equation (6.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant