Export results (sem regressions)

1,038 views
Skip to first unread message

rene...@gmail.com

unread,
May 31, 2016, 9:21:59 AM5/31/16
to lavaan
Hi everyone,

I would to export the summary results of my SEM-model to an excel- or csv-flie (specifically the regressionparameters, the estimates, p and std.all).
Does someone know what syntax I could use?

Thanks in advance! :)
Message has been deleted

Niels

unread,
May 31, 2016, 11:00:53 AM5/31/16
to lavaan

You can use:
clipboard(model_fit,fit.measures=TRUE,standardized=TRUE, rsquare = TRUE)

Or if you just want the std.all regressionparameters:
pathcoeff<-parameterEstimates(model.fit, standardized=TRUE)[,c(1:3,5:8,12)] %>% filter(op == "=~")
pathcoeff<-as.data.frame(pathcoeff[,c(1:3,8)])
ztable::ztable(pathcoeff,caption="Table: std. pathcoefficents", digits=3)

Niels

unread,
May 31, 2016, 11:02:53 AM5/31/16
to lavaan
A little correction: You would filter for "~" not for "=~".

Terrence Jorgensen

unread,
Jun 1, 2016, 3:32:29 AM6/1/16
to lavaan
FYI, the clipboard (and saveFile) functions that Niels mentioned are in the semTools package.

Terrence D. Jorgensen
Postdoctoral Researcher, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Reneé van der Zanden

unread,
Jun 6, 2016, 8:21:33 AM6/6/16
to lav...@googlegroups.com
Great! Thanks both of you for your help. It worked perfectly! 

--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/GWEbDl96rXI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.



--
Reneé van der Zanden
tel: +31(0)6 120 564 77

christian...@gmx.at

unread,
Oct 4, 2017, 9:07:41 AM10/4/17
to lavaan
Hi,
I had a similar issue and tried your code:
"pathcoeff<-parameterEstimates(
model.fit, standardized=TRUE)[,c(1:3,5:8,12)] %>% filter(op == "=~")
pathcoeff<-as.data.frame(pathcoeff[,c(1:3,8)])
ztable::ztable(pathcoeff,caption="Table: std. pathcoefficents", digits=3)"

Unfortunately, R writes "Error: could not find function "%>%"
Is there an additional package needed? SemTools doesn't work for that.

Thanks in advance
Reply all
Reply to author
Forward
0 new messages