Skip to content

Commit

Permalink
add detail about specification of model with small-variance priors
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmerkle committed Mar 22, 2024
1 parent ac636c1 commit caf2c7b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vignettes/cross_loadings_strong_priors.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ fit_cl <- bcfa(HS.model.cl, data=HolzingerSwineford1939,
std.lv=TRUE, meanstructure=T)
```

Then you can look at the ```summary()``` of this model and evaluate the cross-loadings. You can specifically see whether any of the cross-loadings seem large enough to suggest that they should be kept in the model, by looking at the posterior mean (```Estimate```) and credible interval.
It is important that, for each factor, the first variable after `=~` is one whose loading we expect to be far from 0. So, in the above model, we specified the regular cfa first (whose loadings we expect to be larger), then the loadings with small-variance priors on a separate line. This is important because, in blavaan, the first loading is either sign constrained or fixed to 1 (depending on `std.lv`). If the posterior distribution of that constrained loading is centered near 0, we may experience identification problems.

After estimation, you can look at the ```summary()``` of this model and evaluate the cross-loadings. You can specifically see whether any of the cross-loadings seem large enough to suggest that they should be kept in the model, by looking at the posterior mean (```Estimate```) and credible interval.

```{r}
summary(fit_cl)
Expand Down

0 comments on commit caf2c7b

Please sign in to comment.