[R-sig-ME] Split-plot experiment with lmer

Ades, James j@de@ @end|ng |rom uc@d@edu
Fri Sep 13 09:04:06 CEST 2019


HI Rabin,

From how I see it, if there aren’t multiple measurings throughout the year, then you’d probably want to keep year as a fixed effect. There are only two time points, which I don’t think is enough for a random intercept…since a random intercept is essentially applying a probability distribution to the given variable (anyone correct me if I’m wrong here).

You say that the experiment is conducted four times. Is that four times within the two years? If that is the case, then I’d just make timepoint the variable and do away with years (unless there’s something specifically important to those two years).

The second model you list has year as a crossed effect. This would depend on the structure of your data, whether or not each rep (block) receives a completely new id, or is merely repeated (1,2,3…18,19,20 through 72 vs 1,2,3…17,18 and then 1,2,3…17,18 again). If it’s the latter, then you’d want everything nested within timepoint so…(1 | timepoint/rep/crop/tillage).

Since you have two locations, you’re right to make location a fixed-effect with an interaction. I’d probably think there would be an interaction of time as well, which is why a model with location*timepoint*crop*tillage*cover + (timepoint | rep/crop/tillage), where you control for time as both a fixed effect and a random slope, might be best (I’ve learned from Thierry that centering time as a random slope is also good practice). I’m not too familiar working with fixed effects as random effects as well.

Regarding assumptions of normality, etc., I’d think you’d want to look at your residuals and whether there is any pattern to their distribution or not. If there isn’t a pattern, then you’d be good to go with lmer.

Again, anyone correct me if I’m wrong on any of this.

Good luck!

James


On Sep 12, 2019, at 11:18 PM, r-sig-mixed-models-request using r-project.org<mailto:r-sig-mixed-models-request using r-project.org> wrote:

Send R-sig-mixed-models mailing list submissions to
r-sig-mixed-models using r-project.org<mailto:r-sig-mixed-models using r-project.org>

To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
or, via email, send a message with subject or body 'help' to
r-sig-mixed-models-request using r-project.org

You can reach the person managing the list at
r-sig-mixed-models-owner using r-project.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-sig-mixed-models digest..."


Today's Topics:

  1. Can we analyse combined split plot experiment using lmer()?
     (Rabin KC)
  2. Using anova vs. Anova for linear mixed model (Kevin Chu)

----------------------------------------------------------------------

Message: 1
Date: Thu, 12 Sep 2019 22:48:19 -0500
From: Rabin KC <kc000001 using umn.edu>
To: r-sig-mixed-models <r-sig-mixed-models using r-project.org>
Subject: [R-sig-ME] Can we analyse combined split plot experiment
using lmer()?
Message-ID:
<CANdRtHuW8TvO+ojspfn3bPdBYGMfeKvLQk-PiE3fu2OA-A4__A using mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hello community,

A few days ago, I posted about using lmer() to analyze a split split-plot
design.
The research design is as such:

I am interested in the response variable biomass of cover crops. I have the
main plots as crops (corn and soybean). The subplot is tillage, which is
randomized within the crops and has 3 levels (conventional-till, no-till,
and strip-till). Within tillage(subplot), 3 cover crop strategies are
randomly assigned (AR, ARCC, ARCCFR). Therefore 1 rep (block) has 18
treatments. The whole experiment is replicated 4 times, therefore, total
experimental units equal to 72 units.

The experiment is conducted in 2 locations for 2 years, therefore total
units equal to 288.

Now the model (as suggested by Peter Claussen in our community) for the
experiment conducted each year and location is :

model <- lmer (biomass ~ crop*tillage*cover+(1|rep/crop/tillage),
data=data)

The random-effects seem to be the split-plot error terms in the above model.

My question now is:

Now when I combine each year and location, how should I model this
experiment. I am thinking about the following model:

model.all <- lmer (biomass ~location*
crop*tillage*cover+(1|year/rep/crop/tillage), data=data)

Where location is a fixed effect and year is a random effect.

Does this above model actually work? Or should it be like follows:

model.all.1<- lmer (biomass ~ crop*tillage*cover+(1|year)+
(1|rep/crop/tillage), data=data)

Also, I would be very grateful if someone would advise me if the
assumptions of normality and constant variances apply for these lmer models?

Thank you,
Rabin

[[alternative HTML version deleted]]




------------------------------

Message: 2
Date: Thu, 12 Sep 2019 18:14:13 +0000
From: Kevin Chu <kevin.m.chu using duke.edu>
To: "r-sig-mixed-models using r-project.org"
<r-sig-mixed-models using r-project.org>
Subject: [R-sig-ME] Using anova vs. Anova for linear mixed model
Message-ID:
<SN6PR05MB430253EBEE1E4D1D021594B9D3B00 using SN6PR05MB4302.namprd05.prod.outlook.com>

Content-Type: text/plain; charset="iso-8859-1"

Hello,

I built a linear mixed effects model with three fixed factors and one random factor. I want to test for statistical significance of the fixed effects using F-tests from a type III ANOVA table. Since I am using a type III ANOVA, I understand that I need to set the contrasts to contr.sum so that the sums of squares are calculated correctly.

These are the data types.

str(mydata)
'data.frame': 280 obs. of  5 variables:
$ SUBJECT  : Factor w/ 20 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 1 ...
$ CONDITION: Factor w/ 4 levels "anechoic","aula",..: 1 1 1 1 2 2 2 2 3 3 ...
$ CHANNEL  : Factor w/ 2 levels "0","1": 1 1 2 2 1 1 2 2 1 1 ...
$ STRATEGY : Factor w/ 2 levels "0","1": 1 2 1 2 1 2 1 2 1 2 ...
$ SCORE    : num  107.4 57 90.1 96.1 -16.4 ...

Below is the code I used to generated the model.

lmm <- lmer(SCORE ~ CONDITION * CHANNEL * STRATEGY + (1 | SUBJECT), data=mydata, contrasts=list(CONDITION=contr.sum, CHANNEL=contr.sum, STRATEGY=contr.sum))

I tried passing lmm through anova from the stats package and Anova from the car package, but I obtained different results (screenshots are attached).

My questions:
1) Why do anova and Anova give different results even though I specified type III ANOVA?
2) Why is the Sum Sq equal to 0 in the table produced by anova?

I would prefer not to release the data as I plan to publish a paper based on my results, but if it helps I can create dummy data.

Thank you,
Kevin Chu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Anova_car.png
Type: image/png
Size: 102189 bytes
Desc: Anova_car.png
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20190912/7a584988/attachment.png>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: anova_stats.png
Type: image/png
Size: 125109 bytes
Desc: anova_stats.png
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20190912/7a584988/attachment-0001.png>


------------------------------

Subject: Digest Footer

_______________________________________________
R-sig-mixed-models mailing list
R-sig-mixed-models using r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models


------------------------------

End of R-sig-mixed-models Digest, Vol 153, Issue 15
***************************************************


	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list