Running Script Without Covariate

Hi,

I was wondering how to best alter the script for the sex-limitation models if not including a covariate?

As far as I can tell, I would not run covVars, defAge, or pathB. This means other lines of the script need to be adapted - but I’m not entirely sure of all the lines or how to adjust appropriately.

Hoping someone can assist! Thanks!

@hmaes

Hi @hallerl1

There are a couple of approaches you could take. The simplest one is to merely set to zero and fix all the coefficients that correspond to the covariate effects.

If you have some algebra like

moderatedParam = m1 * data.Sex

then simply set m1 to be zero and make it free=FALSE. A convenient way to do this is with omxSetParameters().

modAlgebra <- mxAlgebra(m1 * data.Sex, name='moder_name')
# ...
modModel <- mxModel(..., modAlgebra)
# ...

# Create model with covariate effects set to zero
nomodModel <- omxSetParameters(modModel, labels='m1', free=FALSE, values=0)

# Run model with covariate effects set to zero
nomodRun <- mxRun(nomodModel)

Hope that helps!
Mike Hunter