integrate data points to plot

23 views
Skip to first unread message

Daniel Groß

unread,
Jun 1, 2018, 10:15:32 AM6/1/18
to lavaan

Hello,


my question is whether it is possible to integrate and show data points in a graphic which is built out of a lavaan calculated SEM? Below is my code

fit <- sem(HS.model, data = data.AOP,std.lv=T, estimator ="MLM")
summary(fit, standardized=T, fit.measures=T)

# simple slope analysis

result2wayMC <- probe2WayMC(fit, c("EF","AOP","EF.AOP"),
                            "BSCS",c("AOP"), c(-1, 1))

result2wayMC

plotProbe(result2wayMC, xlim=c(-1, 1))























Thank you for your help.

Best,

Daniel

Yves Rosseel

unread,
Jun 2, 2018, 6:32:37 AM6/2/18
to lav...@googlegroups.com
As plotProbe() just creates a standard plot, you can add point to that
plot by using the points() function, something like

points(data.AOP$EF, data.AOP$AOP, add = TRUE)

Yves.

On 06/01/2018 04:15 PM, Daniel Groß wrote:
> Hello,
>
>
> my question is whether it is possible to integrate and show data points
> in a graphic which is built out of a lavaan calculated SEM? Below is my code
>
> |
> fit <-sem(HS.model,data =data.AOP,std.lv=T,estimator ="MLM")
> summary(fit,standardized=T,fit.measures=T)
>
> # simple slope analysis
>
> result2wayMC <-probe2WayMC(fit,c("EF","AOP","EF.AOP"),
> "BSCS",c("AOP"),c(-1,1))
>
> result2wayMC
>
> plotProbe(result2wayMC,xlim=c(-1,1))
> |
>
>
>
>
>
>
>
>
> <https://lh3.googleusercontent.com/-1FpNjA5_Jdg/WxFUvKHaxHI/AAAAAAAAAvQ/TXkH8OW1unwNdmNDju3dxXS857qxdKyZQCLcBGAs/s1600/Rplot01.png>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Thank you for your help.
>
> Best,
>
> Daniel
>
> --
> You received this message because you are subscribed to the Google
> Groups "lavaan" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lavaan+un...@googlegroups.com
> <mailto:lavaan+un...@googlegroups.com>.
> To post to this group, send email to lav...@googlegroups.com
> <mailto:lav...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/lavaan.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages