multiple composite variables

459 views
Skip to first unread message

Jes Coyle

unread,
Mar 19, 2013, 3:15:56 PM3/19/13
to lav...@googlegroups.com
Hello,

I am new to sem and have been having difficulty trying to fit models with more that one composite variable in them. I do not know whether this is a problem with model specification (i.e. I'm not doing it right and am having mathematical troubles) or a problem with lavaan's fitting of the model.

In my most basic model I am trying to model the effect of six climatic variables on one response- lichen richness. Two variables, wetness and mat exhibit a unimodal relationship with this variable, so I am attempting to account for this non-linearity using two composite variables, each of which includes a linear and squared term of the climate variable.

This full model will not fit:

clim_mod = '

# Non-linear terms
optimal_wetness <~ 1*wetness + wetness2
wetness ~~ wetness2

optimal_mat <~ 1*mat + mat2
mat ~~ mat2

# Regressions
lichen.rich_log ~ optimal_wetness + optimal_mat + pseas + iso + rain_lowRH
'
clim_fit = sem(clim_mod, data=working_data, meanstructure=T, fixed.x=FALSE)

But the models with only one composite in them will fit:

clim_mod1 = '

# Non-linear terms
optimal_wetness <~ 1*wetness + wetness2
wetness ~~ wetness2

# Regressions
lichen.rich_log ~ optimal_wetness + mat + pseas + iso + rain_lowRH
'

clim_mod2 = '

# Non-linear terms
optimal_mat <~ 1*mat + mat2
mat ~~ mat2

# Regressions
lichen.rich_log ~ wetness + optimal_mat + pseas + iso + rain_lowRH
'

I have also had other instances where models with more than one composite will not fit, but this is the most straightforward example. I have attached a relevant dataframe.
sample_data.csv

yrosseel

unread,
Mar 25, 2013, 4:43:35 AM3/25/13
to lav...@googlegroups.com
On 03/19/2013 08:15 PM, Jes Coyle wrote:
> Hello,
>
> I am new to sem and have been having difficulty trying to fit models
> with more that one composite variable in them. I do not know whether
> this is a problem with model specification (i.e. I'm not doing it right
> and am having mathematical troubles) or a problem with lavaan's fitting
> of the model.

I believe it is the first. Your model is not identified. Remember that
the 'f <~' operator is just syntax sugar for

f =~ 0 # create a phantom latent variable
f ~~ 0*f # fix the residual variance of f to zero

In addition, be very, very careful with the fixed.x=FALSE argument.
Setting it to TRUE again will reveal that you actually have negative
degrees of freedom! So you need to constrain at least one additional
parameter in the two-composite model.

> In my most basic model I am trying to model the effect of six climatic
> variables on one response- lichen richness. Two variables, wetness and
> mat exhibit a unimodal relationship with this variable, so I am
> attempting to account for this non-linearity using two composite
> variables, each of which includes a linear and squared term of the
> climate variable.

Would it not be more straightforward just to include the linear and
quadratic terms in a single regression (ie without constructing composites?)

Yves.

Reply all
Reply to author
Forward
0 new messages