5
$\begingroup$

Muthén & Muthén offer a MPLUS based syntax for calculating sample size and power on SEM, using a Monte Carlo simulation.

https://www.statmodel.com/download/FinalSEMsingle.pdf

Is there any similar syntax available for R?

$\endgroup$

1 Answer 1

5
$\begingroup$

You don't say which package in R you want to use.

You have two choices.

First, calculate your population covariance matrix, and then generate data using the mvrnorm() function in the MASS package. Then estimate your models using your favorite SEM package within R (sem, Lavaan, openMX, etc).

Second, Lavaan, which has a function called simulateData(). This lets you specify a model to generate in Lavaan language, which you can then estimate.

$\endgroup$
2
  • 1
    $\begingroup$ Thanks for response, I am looking for a lavaan compatible approach! :) $\endgroup$
    – Jens
    Jun 13, 2015 at 13:27
  • 2
    $\begingroup$ simulateData() it is then. $\endgroup$ Jun 13, 2015 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.