Skip to content
Prev 15613 / 20628 Next

using lme for cov structures?

Dear Ben,

The correlation structure always works at the most detailed level of the
random effects. E.g. at the id level in the example below, not at the group
level. The correlation is only effective among observations from the same
id. Two observation within the same group but different id have
uncorrelated residuals by definition. Likewise are two residuals from
different groups uncorrelated. The correlation matrix of the residuals is
hence always a block diagonal matrix, with blocks defined by the most
detailed level of the random effects.

opposites <- read.table("
https://stats.idre.ucla.edu/stat/r/examples/alda/data/opposites_pp.txt
",header=TRUE,sep=",")
opposites$group <- opposites$id %% 6
library(nlme)
lme(opp ~ 1, random = ~1|group/id, data = opposites)
lme(opp ~ 1, random = ~1|group/id, data = opposites, correlation =
corAR1(form = ~wave))

Best regards,


ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

2017-07-26 21:45 GMT+02:00 Ben Pelzer <b.pelzer at maw.ru.nl>: