```
# NOT RUN {
# Holzinger and Swineford (1939) example
HS9 <- HolzingerSwineford1939[,c("x1","x2","x3","x4","x5",
"x6","x7","x8","x9")]
# Pearson correlations
lavCor(HS9)
# ordinal version, with three categories
HS9ord <- as.data.frame( lapply(HS9, cut, 3, labels = FALSE) )
# polychoric correlations, two-stage estimation
lavCor(HS9ord, ordered=names(HS9ord))
# thresholds only
lavCor(HS9ord, ordered=names(HS9ord), output = "th")
# polychoric correlations, with standard errors
lavCor(HS9ord, ordered=names(HS9ord), se = "standard", output = "est")
# polychoric correlations, full output
fit.un <- lavCor(HS9ord, ordered=names(HS9ord), se = "standard",
output = "fit")
summary(fit.un)
# }
```

Run the code above in your browser using DataCamp Workspace