# Compute ICC in Substitution dataset, using Test.Administrator as
# clustering unit
data(Substitution)
# Add administrator to the dataset (just randomly allocate labels
# as Test.Administrator, so ICC should be approx. 0)
Substitution$Test.Adminstrator <- NA
Substitution$Test.Adminstrator <- sample(LETTERS[1:10],
replace = TRUE, size = length(Substitution$Test.Adminstrator))
Substitution$Test.Adminstrator <-
as.factor(Substitution$Test.Adminstrator)
ICC_LDST <- ICC(Cluster = Test.Adminstrator, Test.Score = LDST, Data = Substitution)
# Explore results
summary(ICC_LDST)
plot(ICC_LDST)
# Make points in the plot a bit larger and reduce
# the size of labels on the X-axis (initials test administrators)
plot(ICC_LDST, Size.Labels = .5, Size.Points=.5)
Run the code above in your browser using DataLab