designEffect | R Documentation |
Calculate ICC1 and design effect for multilevel analysis
designEffect(df, cluster=cluster, data=df, round1=3)
df |
dataframe or matrix |
cluster |
vector same length as df (e.g Data$team) |
round1 |
round, default to 3 |
data |
dataframe or matrix, default same as df |
ICC is the intraclass correlation coefficient 1."ICC1 represents the amount of individual-level variance that can be explained by group membership" (see more details in (ICC1
)). Design effect is computed according to Hox's (2010) formula.
If cluster size is not the same across groups, sample size mean is used instead.
n |
Cluster size or mean cluster size when groups are different size |
table |
three columns, first indicates variable name, second ICC1 and third indicates design effect |
Ariadna Angulo-Brunet (ariadna.angulo@uab.cat), Carme Viladrich
Hox, J. (2010). Multilevel analysis: techniques and applications. (2nd ed.). New York: NY: Routledge.
ICC1
, mult.icc
, designEffectICC
#generate some random data
x<-1:5
y<-1:10
v1<-sample(x,800,replace=TRUE)
v2<-sample(x,800,replace=TRUE)
v3<-sample(x,800,replace=TRUE)
v4<-sample(x,800,replace=TRUE)
team<- sample(y, 800, replace=TRUE)
df <- data.frame(v1, v2,v3,v4)
designEffect(df, team )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.