piecewiseSEM icon indicating copy to clipboard operation
piecewiseSEM copied to clipboard

how to do statistical tests for compound paths?

Open qdread opened this issue 1 year ago • 0 comments

I really appreciate this great package. I have read through the documentation and I'm not sure if I am missing something. I can't figure out how to do statistical tests on compound paths. For example let's say I have this psem:

psem(
  lmer(y1 ~ x1 + x2 + (1|grp), data = dat),
  lmer(y2 ~ y1 + x1 + x2 + (1|grp), data = dat),
  data = dat
)

I want to calculate a critical value and p-value for two different compound paths: the first is the effect of x1 on y2 mediated by y1 (product of the coefficient of x1 on y1, and the coefficient of y1 on y2), and the second is the total effect of x1 on y2 including the direct effect and the indirect effect mediated by y1 (sum of the coefficient of x1 on y2, and the product from the previous step). In lavaan I can do this by calculating compound path coefficients using the := operator which generates a test statistic for the compound paths. Is such a thing possible in piecewiseSEM?

qdread avatar Jan 25 '24 13:01 qdread