Lords.k: Function for estimating "Lord's k" for Lord's two-term...

View source: R/classification.R

Lords.kR Documentation

Function for estimating "Lord's k" for Lord's two-term approximation to the compound binomial distribution.

Description

Calculates Lord's k.

Usage

Lords.k(x, N, reliability)

Arguments

x

A vector of observed-scores.

N

The test length.

reliability

The test-score reliability coefficient.

Value

A value representing Lord's k

Examples

# 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)

hthaa/betafunctions documentation built on March 10, 2024, 7:20 p.m.