lavaan ERROR: missing observed variables in dataset, Natural Resources Data

3,751 views
Skip to first unread message

krame...@gmail.com

unread,
Feb 14, 2014, 2:34:05 PM2/14/14
to lav...@googlegroups.com
I am running an analysis to look at the impacts of Forest Openings, Deer Density and Landscape Patterns on Woody Regeneration in North-Central PA. I am a beginner at SEM, over half-way through James Grace's. I'm trying to put together preliminary model for an abstract that is due in a few weeks. Currently my model looks like this:

I currently do not have the landscape data on hand, so I tried to run the model leaving that parameter out for now. I ran the R code as:

mod1 <- 'Seedling   ~ Cover + Canopy + Deer
         Cover ~ Deer'

When I go to fit the model I get the response below:

mod1.fit <- sem(mod1, data=ESA_Data)

Error in lav_data_full(data = data, group = group, group.label = group.label,  : 
  lavaan ERROR: missing observed variables in dataset: Seedling

What am I doing wrong? Again, I'm very new so the fix may be something obviously simple, but any help is appreciated.

Jarrett Byrnes

unread,
Feb 14, 2014, 2:36:13 PM2/14/14
to lav...@googlegroups.com
What do you get from names(data)?  Your seedling variable name might be different than you think it is.

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at http://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/groups/opt_out.

krame...@gmail.com

unread,
Feb 14, 2014, 4:20:22 PM2/14/14
to lav...@googlegroups.com
I see, I had to transform my seedlings variable by 100 to get equal variances, and by doing so, that variable Seedling is not in the original data frame. Thanks!
Reply all
Reply to author
Forward
0 new messages