Skip to content

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

6 messages · Nilaya Sharma, Peter Dalgaard, Dieter Menne

#
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)
#
Nilaya Sharma wrote:
Thanks for providing a self-contained example. The error message is really a
bit confusing (anybody around who understands what lme thinks here?), but
the solution is simple. Just make sure that dam and sire are factors:

genetic_evaluation$dam = as.factor(genetic_evaluation$dam)
genetic_evaluation$sire = as.factor(genetic_evaluation$sire)

I recommend the excellent course notes in the MCMCglmm package as a
complementary reading.

Dieter




--
View this message in context: http://r.789695.n4.nabble.com/lme4-problem-model-defining-and-effect-estimation-question-from-new-bird-to-R-community-from-SAS-comy-tp3453530p3453690.html
Sent from the R help mailing list archive at Nabble.com.
#
On Apr 16, 2011, at 09:52 , Dieter Menne wrote:

            
It's not thinking at all, it's just evaluating a:b (so usual model formula interpretation is partially disabled? Hm, well, multiplying the two continuous variables wouldn't make sense either, I suppose.) and what you see is a variant of
[1] 1
Warning messages:
1: In (1:2):(1:2) :
  numerical expression has 2 elements: only the first used
2: In (1:2):(1:2) :
  numerical expression has 2 elements: only the first used