Dear S+ users
Please forgive what must be a basic question, but this is my first
attempt at a mixed-effects model and I would greatly appreciate some guidance
on this matter. I have read through the bulk of Venables and Ripley and
Pinheiro
and Bates and I haven't yet figured out the answer to my question.
I am working in Splus 2000 R.3 and/or R v 2.4.1, Windows 2000 Professional.
I am trying to estimate an equation to predict the proportion of potential
spawning habitat used by herring in British Columbia, Canada. The region I
am looking at is broken
into 8 sampling 'sections'. My dependent variable is the ratio of the number
of spawning beds that contained spawn to the total number of spawning beds
in each section
in each yr. The independent variables that may be related to this ratio
include sea temperature, total herring biomass, date of spawning, and the
mean size of fish each year.
My data look like this: (made up numbers - but there are many zeros in the
data!)
section year pHabitat spawnTiming biomass sst meanLength
1 1953 0.2 102 1000 10
102
1 1954 0.3 103 900
10.2 103
1 1955 0 0 950
10.5 0
2 1953 0.5 95 1000 10
110
2 1954 0.03 89 900
10.2 98
2 1955 0 0 950
10.5 0
I believe (perhaps wrongly?) that a mixed effect model is appropriate for
these data because
they are grouped by section, and the sections are unlikely to be independent.
In fact, I am conducting these analyses to get at the residual correlation
between sections that exists after the
effects of these physical and biological variables have been taken into
account.
I am confused about how to treat the section-invariant variables "biomass"
and "sst".
For the basic model I believe I would write:
y(yr,sec) = b0 + b1(sec) + error (yr, sec)
(single random effect for each section)
lme(pHabitat ~ 1, data=myData, random = ~1|Section)
adding some complexity:
y(yr,sec) = b0 + b1(sec) + b2*meanLength(yr,sec) + b3*spawnTiming(yr,sec)
lme(pHabitat ~ meanLength + spawnTiming, data=myData, random = ~ meanLength
+ spawnTiming|Section)
which I think is allowing length and timing to be random effects within
each section.
The move to 'yr'-only predictors escapes me - any direction would be
greatly appreciated.
Many thanks,
Ashleen
Ashleen Benson, M.Sc.
Doctoral candidate, Fisheries Research Group
School of Resource and Environmental Management
Simon Fraser University
Burnaby, BC V5A1S6
(ph) 604-268-7335
(email) ajbenson@sfu.ca
|