-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
85 lines (59 loc) · 2.72 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo = TRUE,
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# StanDCM <a href='https://www.jihongzhang.org/rpackages/'><img src='man/figures/logo.png' align="right" height="139" /></a>
[![Travis build status](https://travis-ci.org/JihongZ/StanDCM.svg?branch=master)](https://travis-ci.org/JihongZ/StanDCM)
[![R build status](https://github.com/JihongZ/StanDCM/workflows/R-CMD-check/badge.svg)](https://github.com/JihongZ/StanDCM/actions)
## Overview
__StanDCM__ is a helpful tool of estimating Diagnostic Classification Models (DCM) via Stan
## Learning resources
- Check [Jiang and Carter’s (2019) article](https://doi.org/10.3758/s13428-018-1069-9) on Using Hamiltonian Monte Carlo to estimate the log-linear cognitive diagnosis model via Stan
## Features of the package
- Estimating log-linear cognitive diagnosis model (LCDM) and a variety of widely-used models subsumed
by the LCDM, including the DINA model, DINO model, additive-CDM (A-CDM), linear logistic model (LLM), reduced reparametrized unified model (RRUM), multiple-strategy DINA model
for dichotomous responses
- Specifying customized prior distributions for parameters
- Computing can be achieved in parallel environments
- Estimating models within the LCDM model framework using
user-specified design matrix
- Estimating rating scale DCM for ordinal and nominal responses
## Installation
To install this package from source:
1) Users may need to install the
[rstan](https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started) in order to execute the functions of StanDCM package.
2) Windows users should avoid using space when installing rstan.
3) After installing rstan package, users can use the lines beblow to install StanDCM package.
<!-- end list -->
```{r eval=FALSE}
# the development version from GitHub
# install.packages("devtools")
devtools::install_github("JihongZ/StanDCM")
```
The parametric version of DCM R package named GDINA can be found in R CRAN at
[here](https://CRAN.R-project.org/package=GDINA)
## Usage
You can fit a LCDM model:
```{r eval=FALSE}
mod.LCDM <- StanLCDM.run(Qmatrix = Qmatrix,
response.matrix = respMatrix,
iter = 5000, warmup = 1000, chain.num = 5)
summary(mod.LCDM)
```
or you can fit a DINA model by simply using:
```{r eval=FALSE}
mod.DINA <- StanDINA.run(Qmatrix = Qmatrix,
response.matrix = respMatrix,
iter = 5000, warmup = 1000, chain.num = 5)
```
Posterior predictive model checking (PPMC) could be also conducted:
```{r eval=FALSE}
StanDCM.ppmc(mod.LCDM, respMatrix, n.sim = 500, n.burnin = 100)
```