I am think that it is possible to analyse a model with just random effects but I am not sure as I have never done it. I am looking for guidance on whether it is appropriate, what assumptions I need to be aware of, and how to do it properly.
From my study of an insect;
- I have a response variable (age at death, "age")
- Two treatments ("Treat1" and "Treat2") both of which have two levels (Treat1 has "A" and "B", and Treat2 has "P" and "Q")
- There is also 40 genotypes (1-40)
- With four replicates (w,x,y,z) of each combination of Genotype/Treat1/Treat2
- Each replicate contains 50 individuals
Put simply, my data looks like 32000 rows of this:
Treat1 Treat2 Genotype Block Individual Age
A P 1 w 1 23
A P 1 w 2 35
A P 1 w 3 44
. . . . . .
. . . . . .
. . . . . .
B Q 40 z 50 76
I would like to know if each combination of Treat1 and Treat2 (AP,AQ,BP,BQ) have genetic genetic variation - i.e. is there variation between my 40 genotypes within each treatment combination?
I think I need a model for each of AP, AQ, BP, and BQ, along the lines of
Age ~ Genotype [ Treat1 == "A" & Treat2 == "P"] * Block [ Treat1 == "A" & Treat2 == "P"]
Where Genotype and Block are random effects. I hear Gamma distribtions are better to use in lifespan (time to death) models.
My questions are:
a. Is this an appropriate way to show whether or not my genotypes have variation?
b. Can I build the four models as defined above or is that a really poor way of doing it?
c. If possible, what functions should I be using in R (lm, glm, lmer... & summary, summary.lm, aov, anova...)?
d. What should I expect, if gamma is more suitable than gaussian, to see when I compare plot(model)
for gamma compared to gaussian?
This is currently my model...
AP= df$Treat1=="A" & df$Treat2=="P"
apmodel<- lmer(df$Age[AP]~(1|df$Genotype[AP])+(1|df$Block[AP]))
summary(apmodel)
Which I think is right but I'm not sure what to do with the output..
> summary(apmodel)
Linear mixed model fit by REML
Formula: df$Age[AP] ~ (1 | df$Genotype[AP]) + (1 | df$Block[AP])
AIC BIC logLik deviance REMLdev
57343 57371 -28667 57336 57335
Random effects:
Groups Name Variance Std.Dev.
df$Genotype[AP] (Intercept) 17.23798 4.15186
df$Block[AP] (Intercept) 0.15416 0.39263
Residual 93.18777 9.65338
Number of obs: 7757, groups: df$line[AP], 40; df$Block[AP], 4
Fixed effects:
Estimate Std. Error t value
(Intercept) 49.9948 0.6939 72.05
Is there genetic variance??