| lca_difficulty | R Documentation |
Fits an LCA model where item difficulty is parameterized using an unbounded real-valued parameter instead of raw gamma (guessing probability). This is a reparameterized LCA, not an item-response model: it contains no person ability parameter.
lca_difficulty(
transmatrix = NULL,
base_rate = 0.25,
nodk_priors = c(0.35, 0.3, 0.35, 0),
dk_priors = c(0.25, 0.15, 0.1, 0.2, 0.1, 0.1, 0.1, 0)
)
transmatrix |
Transition matrix returned from |
base_rate |
Numeric. Minimum guessing probability (random chance). Default 0.25 (1/4 for 4-choice items). This is the floor for gamma when difficulty -> +Inf. |
nodk_priors |
Optional. Vector of length 4. Starting values for (gg, gk, kk, difficulty). First 3 must sum to 1. |
dk_priors |
Optional. Vector of length 8. Starting values for DK model. First 7 must sum to 1. |
Difficulty-Parameterized LCA Estimation
The relationship between difficulty (d) and gamma is:
\gamma = base\_rate + (1 - base\_rate) \cdot logistic(-d)
Where logistic(x) = 1/(1+exp(-x)). This means:
d = 0: gamma = base_rate + 0.5*(1-base_rate) (middle difficulty)
d -> +Inf: gamma -> base_rate (hard item, random guessing)
d -> -Inf: gamma -> 1 (easy item, always correct even when guessing)
A guess_fit object with additional components:
params |
Parameter matrix with "difficulty" row instead of "gamma" |
gamma |
Derived gamma values from difficulty (added for convenience) |
learning |
Learning estimates (gk or gk + kd) |
# Simulate data with known difficulty
sim <- simulate_lca(n = 500, n_items = 3, difficulty = c(1, 0, -1), seed = 123)
transmatrix <- multi_transmat(sim$pre, sim$post)
# Fit with the difficulty-link parameterization
fit <- lca_difficulty(transmatrix)
fit$params["difficulty", ] # Should recover approximately c(1, 0, -1)
fit$gamma # Derived gamma values
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.