TransWikia.com

How do I insert a CFA output from R into Latex using lavaan and semTable?

TeX - LaTeX Asked by non on April 13, 2021

I am not very experienced when it comes to Latex or R. As said in the title, I have a CFA output I generated with R Studio and now want to insert into Latex. Unfortunately, whenever I do this, my document in Latex no longer compiles.
This is my current code. As you can see I tried multiple packages (stargazer, xtable, semTable) without success so far.

install.packages("semTable")
install.packages("kutils")
library(semTable)
library(kutils)
biimodell <- "Bl=~B1+B2+B3+B4+B5+B6+B7+B8+B9
Ha=~H1+H2+H3+H4+H5+H6+H7+H8+H9+H10"
biifit <- cfa(model=biimodell, data=d, orthogonal=TRUE)
summary(biifit, fit.measures=TRUE, standardized=TRUE)
cfaTable(biifit)
semTable(biifit)
xtable(biifit)
stargazer(biifit)
apa_print(biifit)$estimate$modelfit
compareLavaan(biifit, fitmeas = c("rmsea",
                                  "cfi"))

semTable(biifit, paramSets = "all",
         columns = c(est = "Estimate", se = "SE", z = "z", p = "p"), fits = c("chisq", "cfi", "tli", "rmsea"),
         type = "latex", alpha = c(0.05, 0.01, 0.001))

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP