This package provides a framework for conducting a series of cognitive diagnosis analysis for dichotomous and polytomous responses.
For more details, see here
For an example of how to use the package, see here
Visit here for an online reference
Below is an illustration showing some analyses that you could do using the package. You can copy the code, paste and run it in R console. For a more comprehensive example, see this tutorial.
library(GDINA)
dat <- sim10GDINA$simdat
Q <- matrix(c(1,0,0,
0,1,0,
0,0,1,
1,0,1,
0,1,1,
1,1,0,
0,0,1,
1,0,0,
1,1,1,
1,0,1),byrow = T,ncol = 3)To avoid using fixed cutoffs and also take uncertainty in item parameter estimation into account, you may consider the stepwise method:
To further examine the q-vectors that are suggested to be modified, you can draw mesa plots:
# test level absolute fit
mft <- modelfit(est)
mft
# item level absolute fit
ift <- itemfit(est)
ift
summary(ift)
plot(ift)The bundled real-data examples do not include respondent-level
covariates, so in the code below the covariates are just placeholders
for user-supplied background variables collected outside the response
matrix. The GDINA fit is real, based on the ECPE data, while the
covariate frame Z is only used to illustrate the
ThreeStepCov() workflow.
dat <- realdata_ECPE$dat
Q <- realdata_ECPE$Q
ecpe_fit <- GDINA(dat, Q, model = "GDINA")
set.seed(123)
N <- nrow(dat)
Z <- data.frame(
age = round(rnorm(N, mean = 21, sd = 3)),
female = rbinom(N, 1, 0.55),
program = factor(sample(c("intensive", "regular", "self-study"), N, replace = TRUE))
)
# Attribute-level regression with the three-step correction
att_reg <- ThreeStepCov(
ecpe_fit,
~ age + female + program,
data = Z,
level = "attribute"
)
att_reg$results[[1]]$corrected$table
att_reg$results[[1]]$naive$table
# Profile-level regression for the estimated latent classes
profile_reg <- ThreeStepCov(
ecpe_fit,
~ age + female + program,
data = Z,
level = "profile"
)
head(profile_reg$results$corrected$table)At the attribute level, each element of att_reg$results
contains both the naive logistic regression and the corrected regression
for one attribute. At the profile level,
profile_reg$results$corrected$table returns the multinomial
logit coefficients relative to the reference latent profile.
If you would like to contribute an example to this website, please send me your .Rmd file.