The measurement model controls how the attributes relate to items
The structural model controls how the attributes relate to each other
\[ \mu_c = \color{#D55E00}{\sum_{a=1}^A\gamma_{1,(a)}\alpha_{ca}} + \color{#009E73}{\sum_{a=1}^{A-1}\sum_{a^\prime=a+1}^A\gamma_{2,(a,a^\prime)}\alpha_{ca}\alpha_{ca^\prime}} + ... + \color{#56B4E9}{\gamma_{A,(a,a^\prime,...)}\prod_{a=1}^A\alpha_{ca}} \]
\[ \nu_c = \frac{\exp(\mu_c)}{\sum_{c=1}^C\exp(\mu_c)} \]
All possible interactions: saturated model, equivalent to an unconstrained model
Only main effects: Attributes are independent (i.e., no interactions allowed)
Additional interactions allows for additional moments of the latent variables
Open structural-models.Rmd and run the setup chunk.
Create a model specification for the PIE field test data
Without any ordering, there are 2A possible profiles
Some profiles may be theoretically impossible given what we know about the domain
| Morphosyntactic | Cohesive | Lexical |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
| 1 | 1 | 0 |
| 1 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| Morphosyntactic | Cohesive | Lexical |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
| 1 | 1 | 0 |
| 1 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| Morphosyntactic | Cohesive | Lexical |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
| 1 | 1 | 0 |
| 1 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| Morphosyntactic | Cohesive | Lexical |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
| 1 | 1 | 0 |
| 1 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| Morphosyntactic | Cohesive | Lexical |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
| 1 | 1 | 0 |
| 1 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| Morphosyntactic | Cohesive | Lexical |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
| 1 | 1 | 0 |
| 1 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| Morphosyntactic | Cohesive | Lexical |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
| 1 | 1 | 0 |
| 1 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| model | description | measr |
|---|---|---|
| HDCM | Hard constraints on profiles based on attribute dependencies | hdcm() |
| BayesNet | Soft constraints on profiles based on attribute dependencies | bayesnet() |
Attribute structure is defined using a DAG-like syntax
Arrows indicate the direction of the relationship



We hypothesize that our PIE attributes follow a linear hierarchy
Fit an HDCM to the PIE data where Level 1 is required before Level 2, and Level 2 is required before Level 3
"rstan" as the backendWe can enforce a hierarchy on our model
Is that structure supported by the data we gathered?
Just like with the measurement models, we can use model comparisons to test our hypothesis
If structure holds, the two models should be about equal (i.e., removing profiles doesn’t hurt anything)
ecpe_spec <- dcm_specify(
qmatrix = ecpe_qmatrix,
identifier = "item_id",
measurement_model = lcdm(),
structural_model = unconstrained()
)
ecpe_lcdm <- dcm_estimate(
dcm_spec = ecpe_spec,
data = ecpe_data,
identifier = "resp_id",
method = "pathfinder",
backend = "cmdstanr",
single_path_draws = 1000,
num_paths = 10,
draws = 2000,
file = here("materials", "slides", "fits", "ecpe-lcdm-uncst")
)Compare our unconstrained model to the HDCM we just estimated
Which model is preferred? What does that tell us about our theory?
pie_lcdm_spec <- dcm_specify(
qmatrix = pie_ft_qmatrix,
identifier = "task",
measurement_model = lcdm(),
structural_model = unconstrained()
)
pie_lcdm <- dcm_estimate(
pie_lcdm_spec,
data = pie_ft_data,
identifier = "student",
method = "mcmc",
backend = "rstan",
chains = 2,
iter = 2000,
warmup = 1000,
cores = 2,
file = here("materials", "slides", "fits", "pie-lcdm-uncst")
)Structural models
Specification and estimation