Discussion:
[R-sig-ME] Specifying and fitting LME model with unstructured error correlation within subject
Kogan, Clark
2018-11-30 17:20:01 UTC
Permalink
I have some data where a number of individuals have taken a few different subtests and there is 1 response per individual for each subtest. I am fitting the following model using lmer:

mod <- lmer(score ~ faculty + gender + subtest + gender:subtest + faculty:gender + faculty:subtest+ (subtest|id), data = score)

When fitting this model, I get the error:
Error: number of observations (=219) <= number of random effects (=219) for term (subtest | id); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable

The error makes sense to me - as there is only one data point for every subtest*id, and so we cannot differentiate the random effects from the residuals. What I would like to be able to do is specify that the residuals have an unstructured correlation matrix within individuals to account for the fact that an individual will likely have some correlation between their subtest scores.

Is there a way to do this in lmer or a similar package so that I can still get Kenwood Rodgers or Satterthwaite corrected tests of effects (e.g., with pbkrtest or lmerTest).

Thanks,
Clark


[[alternative HTML version deleted]]
Clark Kogan
2018-12-02 23:22:03 UTC
Permalink
Thierry,

I believe this will induce a compound symmetric covariance structure rather
than an unstructured covariance structure. I would like to allow for unique
correlations between different subtests.

Thanks,
Clark


On Sun, Dec 2, 2018 at 11:58 AM Thierry Onkelinx via R-sig-mixed-models <
Dear Kogan,
Add (1|id) as random effect. This will induce a correlation among the
observations from the same individual.
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be
///////////////////////////////////////////////////////////////////////////////////////////
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
///////////////////////////////////////////////////////////////////////////////////////////
<https://www.inbo.be>
Post by Kogan, Clark
I have some data where a number of individuals have taken a few different
subtests and there is 1 response per individual for each subtest. I am
mod <- lmer(score ~ faculty + gender + subtest + gender:subtest +
faculty:gender + faculty:subtest+ (subtest|id), data = score)
Error: number of observations (=219) <= number of random effects (=219)
for term (subtest | id); the random-effects parameters and the residual
variance (or scale parameter) are probably unidentifiable
The error makes sense to me - as there is only one data point for every
subtest*id, and so we cannot differentiate the random effects from the
residuals. What I would like to be able to do is specify that the
residuals
Post by Kogan, Clark
have an unstructured correlation matrix within individuals to account for
the fact that an individual will likely have some correlation between
their
Post by Kogan, Clark
subtest scores.
Is there a way to do this in lmer or a similar package so that I can
still
Post by Kogan, Clark
get Kenwood Rodgers or Satterthwaite corrected tests of effects (e.g.,
with
Post by Kogan, Clark
pbkrtest or lmerTest).
Thanks,
Clark
[[alternative HTML version deleted]]
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
[[alternative HTML version deleted]]
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
[[alternative HTML version deleted]]
Ben Bolker
2018-12-03 00:17:44 UTC
Permalink
I'd suggest using control=lmerControl(...) to override the error
(something like check.nobs.vs.nRE="ignore", but you can look it up in
the help page ...). Your residual variance and random-effects
variances will indeed be confounded, and I can't say for sure how it
will affect the Kenward-Roger [sic] degrees of freedom calculation,
but the estimates of the fixed effects and their standard errors
should still be correct.

Actually, if you want Kenward-Roger, that may be the only option I
can think of (other than switching to SAS or something ...) For
various technical reasons previously described on this list (and in
the lme4 paper), it's not possible to force the residual variance to
zero and remove the confounding (or, in fact, to any specified value).
You _can_ fix the residual variance to a very small value (but not
exactly zero) by setting a prior in blme::blmer(), or you can fit a
model without a residual variance in glmmTMB (using dispformula ~ 0),
but ... these models won't work with lmerTest to give you
degrees-of-freedom calculations, as far as I know.
Post by Clark Kogan
Thierry,
I believe this will induce a compound symmetric covariance structure rather
than an unstructured covariance structure. I would like to allow for unique
correlations between different subtests.
Thanks,
Clark
On Sun, Dec 2, 2018 at 11:58 AM Thierry Onkelinx via R-sig-mixed-models <
Dear Kogan,
Add (1|id) as random effect. This will induce a correlation among the
observations from the same individual.
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be
///////////////////////////////////////////////////////////////////////////////////////////
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
///////////////////////////////////////////////////////////////////////////////////////////
<https://www.inbo.be>
Post by Kogan, Clark
I have some data where a number of individuals have taken a few different
subtests and there is 1 response per individual for each subtest. I am
mod <- lmer(score ~ faculty + gender + subtest + gender:subtest +
faculty:gender + faculty:subtest+ (subtest|id), data = score)
Error: number of observations (=219) <= number of random effects (=219)
for term (subtest | id); the random-effects parameters and the residual
variance (or scale parameter) are probably unidentifiable
The error makes sense to me - as there is only one data point for every
subtest*id, and so we cannot differentiate the random effects from the
residuals. What I would like to be able to do is specify that the
residuals
Post by Kogan, Clark
have an unstructured correlation matrix within individuals to account for
the fact that an individual will likely have some correlation between
their
Post by Kogan, Clark
subtest scores.
Is there a way to do this in lmer or a similar package so that I can
still
Post by Kogan, Clark
get Kenwood Rodgers or Satterthwaite corrected tests of effects (e.g.,
with
Post by Kogan, Clark
pbkrtest or lmerTest).
Thanks,
Clark
[[alternative HTML version deleted]]
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
[[alternative HTML version deleted]]
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
[[alternative HTML version deleted]]
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Loading...