Skip to content
Prev 257047 / 398506 Next

lme4 problem: model defining and effect estimation ------ question from new bird to R community from SAS community

On Apr 16, 2011, at 04:21 , Nilaya Sharma wrote:

            
....
You're missing the equivalent of the SAS class statement. Grouping variables need to be factors:

genetic_evaluation<-transform(genetic_evaluation,
 sire=factor(sire),
 dam=factor(dam))

Also, you probably don't want a random main effect of dam, so

lmer(adg ~ 1 + (1|sire) + (1|dam:sire), data=genetic_evaluation)

or even

lmer(adg ~ 1 + (1|sire/dam), data=genetic_evaluation)