[R] Help with lme Random Factor

Andrew James Amacher aamacher at nature.berkeley.edu
Thu Mar 10 01:19:22 CET 2005


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 complex
mixed 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 comparing
the treatments to the control (multiple comparisons w/ a control). 
Treatment group is not a part of the lme script.  Do I need to run them
each 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 contrasts
with controls.

Cheers,

Andrew




More information about the R-help mailing list