Hi,

Are there any example scripts for how to add a definition variable to a RAM model, and how to then use that in an algebra on a path?

Here's one adding a definition variable for means, but not including its value in an algebra, and then using that algebra to se the value for another path.

https://openmx.ssri.psu.edu/docs/OpenMx/2.5.1/DefinitionMeans_Path.html

inst/models/nightly/univACErSEM.R

Thanks Josh,

Wanting an example to point people to with comments on most lines explaining how the script works. Also one just showing "Here is how to create a moderated path in RAM" rather than more complex example for learning.

Reading through univACErSEM.R now: The definition variables are used on paths directly, rather than being used to moderate a path (i.e., compute the path based on the definition variable. e.g.

This example shows how a def var can be used to moderate the effect of x on y by faking a latent variable which is set to have a mean equal to

`def`

, and having a path from x to y go via this latent variable.But can it be extended to the typical case of

?

i.e., to include the def on the diagram as a manifest, and use it as a definition variable?