| Title: | Sparse Latent Class Model for Cognitive Diagnosis |
| Version: | 0.1.1 |
| Description: | Perform a Bayesian estimation of the exploratory Sparse Latent Class Model for Binary Data described by Chen, Y., Culpepper, S. A., and Liang, F. (2020) <doi:10.1007/s11336-019-09693-2>. |
| License: | GPL-2 |GPL-3 [expanded from: GPL (≥ 2)] |
| URL: | https://tmsalab.github.io/slcm/,https://github.com/tmsalab/slcm |
| BugReports: | https://github.com/tmsalab/slcm/issues |
| Depends: | R (≥ 4.3.0) |
| Imports: | Rcpp (≥ 1.1.0), edmdata |
| LinkingTo: | Rcpp, RcppArmadillo (≥ 15.0.2-2) |
| Suggests: | altdoc |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| NeedsCompilation: | yes |
| Packaged: | 2025-09-26 16:58:03 UTC; ronin |
| Author: | James Joseph Balamuta |
| Maintainer: | James Joseph Balamuta <balamut2@illinois.edu> |
| Repository: | CRAN |
| Date/Publication: | 2025-09-28 12:20:02 UTC |
slcm: Sparse Latent Class Model for Cognitive Diagnosis
Description
Perform a Bayesian estimation of the exploratory Sparse Latent Class Model for Binary Data described by Chen, Y., Culpepper, S. A., and Liang, F. (2020)doi:10.1007/s11336-019-09693-2.
Author(s)
Maintainer: James Joseph Balamutabalamut2@illinois.edu (ORCID) [copyright holder]
Authors:
Steven Andrew Culpeppersculpepp@illinois.edu (ORCID) [copyright holder]
See Also
Useful links:
Report bugs athttps://github.com/tmsalab/slcm/issues
Generate attribute pattern table header
Description
Generate attribute pattern table header
Usage
attribute_pattern_table_header(k, m = 2, order = k)Arguments
k | Number of Attributes. |
m | Number of Categories. Default 2 or dichotomous response. |
order | Order of the table. Default |
Value
Return a matrix containing the class table
Examples
# K = 3attribute_pattern_table_header(3)# K = 4attribute_pattern_table_header(4)Print the SLCM object
Description
Custom printing class to reveal features of the fitted SLCM.
Usage
## S3 method for class 'slcm'print(x, digits = max(3L, getOption("digits") - 3L), ...)Arguments
x | the |
digits | the number of significant digits |
... | further arguments passed to or from other methods. |
Value
Print details and estimates found within the fitted SLCM.Return the model invisibly (viainvisible())
Sparse Latent Class Model for Cognitive Diagnosis (SLCM)
Description
Performs the Gibbs sampling routine for a sparse latent class modelas described in Chen et al. (2020) <doi: 10.1007/s11336-019-09693-2>
Usage
slcm( y, k, burnin = 1000L, chain_length = 10000L, psi_invj = c(1, rep(2, 2^k - 1)), m0 = 0, bq = 1)Arguments
y | Item Matrix |
k | Dimension to estimate for Q matrix |
burnin | Amount of Draws to Burn |
chain_length | Number of Iterations for chain. |
psi_invj,m0,bq | Additional tuning parameters. |
Details
Theestimates list contains the mean information from the samplingprocedure. Meanwhile, thechain list contains full MCMC values. Lastly,thedetails list provides information regarding the estimation call.
Value
Anslcm object containing three named lists:
estimatesbeta: Average beta coefficientstheta: Average theta coefficientsdelta: Average activeness of coefficientsclass: Average class membershippi: Average attribute class probability.omega: Average omegaq: Average activeness of Q matrix entries based on heuristic transformation.m2ll: Average negative two times log-likelihood
chaintheta: theta coefficients iterationsbeta: beta coefficients iterationsclass: class membership iterationspi: attribute class probability iterationsomega: omega iterationsm2ll: Negative two times log-likelihood iterations
detailsn: Number of Subjectsj: Number of Itemsk: Number of Traitsl1: Slab parameterm0,bq: Additional tuning parametersburnin: Number of Iterations to discardchain_length: Number of Iterations to keepruntime: Duration of model run inside of the C++ code. (Does not include summarization of MCMC chain.)package_version: Version of the package the SLCM model was fit with.date_time: Date and Time the model was fit.
Examples
# Load Namespacenaming = requireNamespace("edmdata", quietly = TRUE)# Use a demo data set from the paperdata("items_matrix_reasoning", package = "edmdata") burnin = 50 # Set for demonstration purposes, increase to at least 1,000 in practice.chain_length = 100 # Set for demonstration purposes, increase to at least 10,000 in practice. model_reasoning = slcm(edmdata::items_matrix_reasoning, k = 4, burnin = burnin, chain_length = chain_length) print(model_reasoning)