# NOT RUN {
# Generate some fictional data. Say, 100 individuals take a test with a
# maximum score of 100 and a minimum score of 0.
set.seed(1234)
testdata <- rbinom(100, 100, rBeta.4P(100, .25, .75, 5, 3))
hist(testdata, xlim = c(0, 100))
# Suppose the cutoff value for attaining a pass is 50 items correct, and
# that the reliability of this test was estimated to 0.7. To estimate and
# retrieve the estimated parameters, confusion matrix, consistency and
# accuracy statistics using LL.CA():
LL.CA(x = testdata, reliability = .7, cut = 50, min = 0, max = 100)
# Alternatively to supplying scores to which a true-score distribution is
# to be fit, a list with true-score distribution parameter values can be
# supplied manually, foregoing the need for actual data. The list entries
# must be named. "l" is the lower-bound and "u" the upper-bound location
# parameters of the true-score distribution, and "alpha" and "beta" the
# shape parameters.
trueparams <- list("l" = 0.25, "u" = 0.75, "alpha" = 5, "beta" = 3)
LL.CA(x = trueparams, reliability = .7, cut = 50, min = 0, max = 100)
# }
Run the code above in your browser using DataCamp Workspace