[R] Help with lme Random Factor
Andrew Robinson
andrewr at uidaho.edu
Thu Mar 10 01:39:27 CET 2005
Hello Andrew,
I strongly suggest that you obtain a copy of the book that documents the use of the package, and read it.
Mixed Effects Models in S and S-Plus
by Jose C. Pinheiro and Douglas M. Bates Springer Verlag 2000.
I hope that this helps,
Andrew
----- Original Message -----
From: Andrew James Amacher <aamacher at nature.berkeley.edu>
Date: Wednesday, March 9, 2005 4:19 pm
Subject: [R] Help with lme Random Factor
> Hi,
>
> I need help creating a code for a multiple BACI design (Before-After
> Control-Impact) ANOVA. I'm new to R and basically need to run a
> complexmixed model ANOVA that treats location as a random factor.
>
> Data are from a fire experiment, run 2001-2004 (2 years pre, 2 years
> post). Response is bird abundance. 4 Treatments had 3 replicates
> each(forest stands): 1. Control, 2. Prescribed fire only, 3.
> Timber harvesting
> only, and 4. Fire and harvesting.
>
> Basically, I'm having trouble figuring out the code that makes the
> variable "LOC" a random factor.
>
> Also, I'm having trouble figuring out how to script contrasts
> comparingthe treatments to the control (multiple comparisons w/ a
> control).
> Treatment group is not a part of the lme script. Do I need to run
> themeach individually, i.e. C vs. T1, C vs. T2, C vs T3? or can I
> code in
> treatment contrasts?
>
> Script (used S-plus GUI to build it):
>
> GCKI~.+C+B+LOC%in%C+T%in%B+C:B+C:T%in%B+LOC%in%C:B+LOC%in%C:T%in%B
> **unsure what goes here to make LOC random****
>
> Terms:
>
> GCKI: Golden-crowned kinglet abundance.
>
> C: Control-Impact (2 levels, either control (no treatment), or impact
> (received treatment after 2 years)
>
> B: Before-After (2 levels, 2001-2002 = Before, 2003-2004 = After)
>
> T: Time, 4 levels, years 2001, 2002, 2003, 2004
>
> LOC: location, 3 replicates in among the 4 treatments (RANDOM FACTOR)
>
>
> Sorry to write so much, but any help would be appreciated. The ANOVA
> model comes from a book: Monitoring Ecological Impacts: Downes et al.
> 2002.
>
> I am used to running GUIs, but it appears I need to script this
> ANOVA. I
> am unfamiliar with random factor scripts or scripts for multiple
> contrastswith controls.
>
> Cheers,
>
> Andrew
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-
> guide.html
More information about the R-help
mailing list