[R-sig-ME] (in plain text) Replication in nested structure, how much?
Stephen T
stwebvanuatu at yahoo.com.au
Tue Sep 3 17:37:39 CEST 2013
Following classical ANOVA, I thought it important to have replication at each level. Maybe this is not essential for mixed models?
Here's my model: Y~1+(1|SUBJECT/OCCASION)
Each subject was tested on multiple occasions.I want to evaluate the variance within-subjects and variance within-occasions.
I have data for 105 subjects. Occasions per subject ranges from 1 to 4. Repeated measurements of the response Y per occasion range from 1 to 5.
Originally, I thought to restrict the modelling to subjects tested on at least 2 occasions and with at least 2 Y data per occasion. Here are the numbers of "levels" in the reduced dataset:
> model=lmer(Y~1+(1|SUBJECT/OCCASION), data=reduced)
> # subjects
> length(ranef(model, standard=TRUE)[[2]][, 1])
[1] 57
> # occasions
> length(ranef(model, standard=TRUE)[[1]][, 1])
[1] 138
> # Y measurements
> length(resid(model))
[1] 353
And here's what I get with the full dataset:
> model=lmer(Y~1+(1|SUBJECT/OCCASION), data=full)
> length(ranef(model, standard=TRUE)[[2]][, 1])
[1] 105
> length(ranef(model, standard=TRUE)[[1]][, 1])
[1] 196
> length(resid(model))
[1] 471
There are some potential issues in the full dataset affecting 48/105 of the subjects:
1) No replication (i.e. subjects measured on 1 occasion and once).
2) No replication of occasions (i.e. subjects measured multiple times but on 1 occasion).
3) No replication of measurements on some occasions (i.e. subjects measured on multiple occasions but sometimes with only 1 measurement per occasion).
I do not want to ignore potentially informative data and the precision for random effect results seems to improve with the full dataset.
I welcome some guidance on how I should proceed. Perhaps some of the issues 1), 2), 3) are allowable and some are not?
Stephen.
More information about the R-sig-mixed-models
mailing list