View source: R/classification.R
Lords.k | R Documentation |
Calculates Lord's k.
Lords.k(x, N, reliability)
x |
A vector of observed-scores. |
N |
The test length. |
reliability |
The test-score reliability coefficient. |
A value representing Lord's k
# Generate some fictional data. Say 100 students take a 50-item long test
# where all items are equally difficult (i.e., where the true Lord's k = 0).
set.seed(1234)
p.success <- rBeta.4P(100, 0.25, 0.75, 5, 3)
for (i in 1:50) {
if (i == 1) {
rawdata <- matrix(nrow = 100, ncol = 50)
}
rawdata[, i] <- rbinom(100, 1, p.success)
}
# Estimate the reliability of these scores with Cronbach's Alpha:
reliability <- cba(rawdata)
# Estimate Lord's k using Lords.k():
Lords.k(rowSums(rawdata), 50, reliability)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.