andkov / Multilevel-models-of-NLSY-97-religion-data

This project looks at religious attendance data of NLSY-97 in the Multilevel Modeling framework. Completed as a class project for MLM class in Fall 2012 Kris Preacher course at Vanderbilt.
1 stars 3 forks source link

Extracting model predictions (@eta) from lmerMod objects #1

Closed andkov closed 7 years ago

andkov commented 10 years ago

Open repository Run "1.ISE-NLSY97-Religion.R" This will produce the data and run the first model, creating an lmer object. Now we want to extract the model predictions form in. In the "3.plotting lmer results in ggplot2.R" lines 21-26 are supposed to do that but throw an error Error in data.frame(model@flist, timec = model@X[, 2], YHat = model@eta) : no slot of name "X" for this object of class "lmerMod"

This is strange, because it used to work. Any thought what might be the matter?

wibeasley commented 10 years ago

Can you paste or link to the code? My first suspect with lme4 is making sure I made the variable a factor.

andkov commented 10 years ago

https://github.com/andkov/Multilevel-models-of-NLSY-97-religion-data/blob/master/3.plotting%20lmer%20results%20in%20ggplot2.R

lines 21-26

andkov commented 10 years ago

this (https://github.com/andkov/Multilevel-models-of-NLSY-97-religion-data/commit/61911dee9adff5e31a3e356b2481cd78e214a322) is an attempt at a work around, but i'm not sure what i'm doing here, really

wibeasley commented 7 years ago

I think it's done/resolved. Reopen if not.