##Creating a table with latent factor correlation
parameterEstimates(modelfitted2, standardized=TRUE) %>%
filter(op == "~~",
lhs %in% c("ATT", "SNORM", "PBC","INT", "BEH"),
!
is.na(pvalue)) %>% mutate(stars = ifelse(pvalue < .001, "***",
ifelse(pvalue < .01, "**",
ifelse(pvalue < .05, "*", "")))) %>%
select('Factor 1'=lhs,
'Factor 2'=rhs,
Correlation=est,
sig=stars) %>% kable(digits = 2, format="pandoc", caption="Table 3: Latent Factor Correlations")