[R-sig-ME] Linear Mixed Effects vs. Repeated Measures
Mike Lawrence
mike.lwrnc at gmail.com
Mon Oct 8 17:46:09 CEST 2012
Using lme4 syntax, I believe you want:
lmer_fit1 = lmer(
data = df
, formula = Response ~ Year + (1+Year|Tree)
)
contrast this with a model that assumes a constant effect of Year
across levels of Tree:
lmer_fit2 = lmer(
data = df
, formula = Response ~ Year + (1|Tree)
)
anova(lmer_fit1,lmer_fit2)
On Sun, Oct 7, 2012 at 4:42 PM, Cortin A. Zelaznog <cortin08 at yahoo.com> wrote:
> Hi All,
>
> I have 46 replicate trees I sampled in a 2 year survey.
> My objective is: To estimate the proportion of variation among-trees w/in year, and proportion variation due to among year and tree interaction.
>
> Response Year Tree
> 23 A 1
> 12 A 2
> 54 A 3
> 23 B 1
> 12 B 2
> 9 B 3
> The above is an example of my dataset
>
>
> Circularity was violated, so instead of running a Repeated Measures I am running a mixed effects model. With trees as random and year as fixed. I'm then running a variance components analysis.
>
> Q1. Is this a good way to test the above questions?
>
> My model is this: lme <-lme(response~year,random=~1|tree/year,df)
>
> I am not getting an interaction term here, nor do I when I run an aov model using tree*year as a factor.
>
> Q2. I'm wondering why I'm not coming up with an interaction term for year and tree using aov or lme even though my variance comp. analysis says that most of the variation (55%) is due to year and tree interaction.
>
> Thanks!!
>
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list