Need some help interpreting the summary() -function results.
I am running a lme from the package nlme in R.
I have a simple (and quite small) dataset with three grouping variables: origin, genotype and time, response is a continuous variable named Maxi.
Origin = 2 levels, called Ka and La
Genotype = 3 levels nested within origin Ka and 2 levels nested within origin La
Time = 2 levels nested within each genotype
I am interested in the main effects of Origin, Time and their interaction. In addition to testing I'd like to have their estimates. I want to model the random part as Genotype nested within Origin. Here's the model I had in mind:
model = lme(fixed = Maxi ~ Origin*Time, random = ~ 1 |Genotype)
anova()s etc work fine and there's actually no significant interaction, but
here's the problem:
when I run summary(model), I get:
Fixed effects: Maxi ~ Origin * Time
Value Std.Error DF t-value p-value
(Intercept) 15.399386 1.1127382 20 13.839181 0.0000
OriginLa -1.986388 1.7702416 3 -1.122100 0.3435
Timeeve 0.074444 0.8942694 20 0.083246 0.9345
OriginLa:Timeeve -1.387448 1.5648876 20 -0.886612 0.3858
Where are my estimates for the other levels of the factors? I thought that to be able to interpret these fixed effects the summary-table would have to show all the levels in some manner? Or do I interpret this such that:
- the estimate for OriginKa is 15.399386
- the estimate for OriginLa is 15.399386-1.986388
- the estimate for Timemor is 15.399386
the estimate for Timeeve is 15.399386+0.074444
and then I can't even guess how to interpret the interaction estimate...
It doesn't feel intuitively right that the estimates would be the same for both a level of the Origin -factor and a level of the Time factor.
Notes:
- I did NOT make my data into a groupedData (is it always necessary?)
- I wanted to include random = 1 ~ |Origin/Genotype in the model but that produced NaNs in the output, apparently the model became too complex or my data is arranged wrongly?
So the Questions are:
- How do I interpret the summary to get the estimates, or is there something wrong here, or is there another way of getting the estimates. I need the estimates for both levels of Time within both Origins.
- How do I specify the random effects with this data structure? Have I done it right?
Any pointers?
Here's the data needed to reproduce my problem:
Orig.Genot.Time Maxi
Ka Ka1 mor 14,59
Ka Ka1 eve 13,42
Ka Ka11 mor 14,08
Ka Ka11 eve 16,29
Ka Ka15 mor 14,38
Ka Ka15 eve 14,56
La La1 mor 17,82
La La1 eve 13,28
Ka Ka1 mor 16,44
Ka Ka1 eve 15,52
Ka Ka15 mor 13,76
Ka Ka15 eve 13,55
Ka Ka1 mor 19,15
Ka Ka1 eve 19,12
La La6 mor 10,54
La La6 mor 11,38
La La6 eve 10,48
Ka Ka15 mor 15,25
Ka Ka15 eve 16,51
La La1 mor 17,46
La La1 eve 15,57
Ka Ka1 mor 16,83
Ka Ka1 eve 15,63
Ka Ka15 mor 14,54
Ka Ka15 eve 15,09
La La1 mor 11,3
La La1 eve 11,94
nlmeto automatically extract these? Or in another package? Even if one really should know how to do the calculation. I think I might be able to do it withpredict.lme, but so far haven't been able to set up the correct newdata -dataframe, perhaps because of the interaction-term?data.frame(Origin = c("Ka", "Ka", "La", "La"), Time = c("mor", "eve", "mor", "eve")), returnscannot evaluate groups for desired levels on 'newdata'– tuhinokkaeläin Feb 23 '15 at 19:28predictdidn't work. You could ask on [SO], since you do have a reproducible example. – gung - Reinstate Monica Feb 23 '15 at 19:32OriginLa, Timeeveis $\beta_0 + \beta_1 + \beta_2 + \beta_3$, whether or not the interaction is significant. – gung - Reinstate Monica Feb 23 '15 at 20:44anova()results forOriginorTime, correct? Similarly, should I then also forfeit making multiple comparisons? Or is that exactly what I should then do, via contrasts (i.e. test simple main effects)? Which leads to another hardship; how to define the contrast matrix in this case... – tuhinokkaeläin Feb 23 '15 at 21:45anova()can be fine, if you want a sequential test (since that is what it does). You already have 4 means, so there is no need for multiple comparisons. – gung - Reinstate Monica Feb 23 '15 at 21:55anova()and to trust it's reported F- and p-values (at least to the extent that they can be trusted in mixed models) regardless of the significance of the interaction term? I'm still confused, but at this point I'm "accepting" your answer (: – tuhinokkaeläin Feb 23 '15 at 23:21anova.lmeinterpretable in the classical sense as a table of tests for differences between the levels? I notice it includes the intercept term as well, and I suppose each term and p-value in the table is then somehow nested within the term before that (or something), similar to the fixed effects table fromsummary(), and that is what you mean with sequential? In the classical hypothesis testing setting, isn'tanova.lmewhat I would use to see if differences exist between the levels of a factor? – tuhinokkaeläin Feb 24 '15 at 18:08anova(model, type = "marginal")produce a table where the SS for a factor are calculated given that all other factors are also in the model? (i.e. classical inference on categorical factors). I'm probably pushing your patience (and the comments section lenght) with my inadequate knowledge, sorry about that. – tuhinokkaeläin Feb 24 '15 at 18:49lmeas an alternative to a more classical ANOVA (which would not accommodate random effects and variance functions etc.), i.e. testing for interesting effects. Is my reasoning... reasonable? Also, is the (un)balancedeness of data an important criterion in selecting the type of testing? – tuhinokkaeläin Feb 25 '15 at 01:02