Closed b1azk0 closed 5 years ago
This isn't really an issue related to the package, but a request for help. Hence, I'm closing this as off topic.
I'd be happy to help you with this through email, but the first thing I'd recommend is figuring out the required equations that you'd need to generate the data. If you can construct a single example of how to do this with code then a Monte Carlo simulation is just a quick generalization of this base example.
Good morning, I was wondering if anyone could help me out in setting up code for a simulation based sample size estimation?
I'm working with a moderated mediation model (Model 14 as per A.Hayes PROCESS templates), where: X is a dichotomous experimental condition (0 and 1) M is a continuous mediator (mean of discrete 1 to 5 items) V is a continuous mediator (mean of discrete 1 to 5 items) Y is a continuous mediator (mean of discrete 1 to 5 items)
When I was analyzing pilot data I mean centered X, M and V, computed the product of M*V by hand and set the analysis syntax in for example
lavaan
.I already learned that I can't run a simulation for sample size using
lavaan
model syntax insimsem
- due to the fact, that I'm introducing a variable being a product of other two variables.I was wondering if you could help me out in working out syntax for such simulation, where conditional indirect effects are hypothesized, and sample size is estimated based on previous research data. For example:
These where the model estimates of a pilot study (analyzed with lavaan)