[R] Help with lme Random Factor

From: Andrew James Amacher <aamacher_at_nature.berkeley.edu>
Date: Thu 10 Mar 2005 - 11:19:22 EST


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****


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.



R-help@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 Received on Thu Mar 10 11:21:43 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:42 EST