[R-sig-eco] Understanding the output from lme anova

Dunbar, Michael J. mdu at ceh.ac.uk
Wed Dec 8 10:30:32 CET 2010


Dear Peter

As Thierry said, it is much easier to create the factors in your data frame and then use them in the model specification

i.e.

Dist_start <- as.factor(Dist_start)
.....

lme(Cyperaceae~Site+Ditch_block+Tree_cut+ Dist_start .....


Regarding the nesting of the fixed terms, I am still unconvinced as to why this is necessary: I repeat the nesting of the fixed effects is handled automatically by how they map across to the random effects: if this is not being handled correctly in the output then you need to look at the coding of the data.

Eg you may have:

lme(grouplevelfixedeffect * observationlevelfixedeffect, random=~1|Groupingvariable)

Effectively observationlevelfixedeffect is nested within grouplevelfixedeffect but there is no need to specify this as the mapping across to the two levels in the model, defined by Groupingvariable and individual observations, is handled automatically.

If you don't believe me then you may wish to ask on the r sig for mixed models.

Regards
Mike



-----Original Message-----
From: Hedberg Peter [mailto:phedberg at biol.uw.edu.pl] 
Sent: 07 December 2010 19:00
To: Dunbar, Michael J.; "r-sig-ecology at r-project.org"
Subject: Sv: RE: [R-sig-eco] Understanding the output from lme anova

Dear Michael

The as.factor terms are used, because several non continues numerical predictors should be treated as factors. I do have several random variables in the model, printed out in the mail with the question, but the problem is that it is necessary to have a nested term in the fixed part of the model as well, and it is not random.

I received an explanation from Thierry that A/B is equal to A+A:B which is the reason for that the output of both nested factors and * interactions are represented with the colon sign. It makes sense, and I have received the answer to my question.

Thank you for taking the time to give me suggestions.

Dunbar, Michael J. <mdu at ceh.ac.uk> skrev :

> Dear Petter
> 
> It is indeed difficult to read your model because you are converting to factors on-the-fly within the model.
> 
> Regarding the nesting, I have never ever seen explicit nesting in the fixed part of the model. Have you copied this format from someone else's model? If you have blocks in the model then they ought to be part of the random effects structure. This sets the structure of the data, and the fixed effects will match across to the relevant level in the random effects: i.e. lme knows which level the fixed effects correspond to, based on how the data are coded. 
> 
> To get some help from the list, it would be useful to have the details on what each variable represents. E.g. how many sites do you have - traditionally site identity would be the sort of thing that would be specified as a random effect unless there are very few levels, but it's impossible to help more without more information.
> 
> Regards
> Mike
> 
> 
> -----Original Message-----
> From: r-sig-ecology-bounces at r-project.org [mailto:r-sig-ecology-bounces at r-project.org] On Behalf Of Hedberg Peter
> Sent: 06 December 2010 14:46
> To: r-sig-ecology at r-project.org
> Subject: [R-sig-eco] Understanding the output from lme anova
> 
> Dear all.
> 
> I have a question regarding how to interpret the output from my lme.anova.
> 
> My model looks like this
> 
> lme_Cyperaceae<-lme(Cyperaceae~Site+Ditch_block+Tree_cut+as.factor(Dist_start)+((as.factor(Dist_start))*Tree_cut)+((as.factor(Dist_ditch))/Ditch_block),random=~1|Mainplot/Transect/Obsplot)
> 
> My question concerns that I use the divission sign to indicate nesting in ((as.factor(Dist_ditch))/Ditch_block), and I use * to indicate two-way interaction in ((as.factor(Dist_start))*Tree_cut), but in the output both terms are presented
> with a colon (:) sign.
> 
> Tree_cut:as.factor(Dist_start)        3     6  0.259899  0.8520
> Ditch_block:as.factor(Dist_ditch)     4    56  2.695738  0.0399
> 
> Is there something wrong in how I wrote the model, or is the colon sign  used for all interactions weather nested or the * type.
> 
> Would be greatly thankful for any help in understanding this.
> 
> The output mentioned above is from an analysis of lme.anova on the result of the lme model.
> 
> Best regards,
> 
> Petter Hedberg
> 
> 
> 
> ___________________________________
> NOCC, http://nocc.sourceforge.net
> 
> 
> 
> 
> -- 
> This email was Anti Virus checked by Astaro Security Gateway. http://www.astaro.com
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> -- 
> This message (and any attachments) is for the recipient only NERC
> is subject to the Freedom of Information Act 2000 and the contents
> of this email and any reply you make may be disclosed by NERC unless
> it is exempt from release under the Act. Any material supplied to
> NERC may be stored in an electronic records management system.

___________________________________
NOCC, http://nocc.sourceforge.net




-- 
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.


More information about the R-sig-ecology mailing list