repeated measures: levels of grouping factor must be less than number of obs
On Mon, Apr 18, 2011 at 9:44 AM, Andrew Miles <rstuff.miles at gmail.com> wrote:
Just to clarify, when you say repeated measures do you mean that you have data from multiple individuals from the same family? ?Or do you mean that you have data on the same individuals across multiple time points (ex. data from person one on Monday, and Tuesday, and Wednesday, etc.)? ?The latter is what is more traditionally referred to as a repeated measures study; the first is simply clustering in the data.
yes, I was unclear. I mean the former: data from multiple individuals in the same family. *In addition*, each proband subject may be represented twice--once for each of his/her siblings.
If the first (i.e. the clustered data), the model you have specified is sufficient. ?Specifically, it will estimate a variance component that will tell you how much variation there is in y between family groups. Hope that helps.
yes, thanks.
Andrew Miles On Apr 18, 2011, at 11:33 AM, Brent Pedersen wrote:
hi, I posted this to the main R mailing list a while back and people directed me to the lme4 package and this mailing list so I thought I might get more help here... We have some data, a subset of which is pasted at the end of this message. I am trying to understand how to do repeated measures as our study design consists of a subject (proband) and 1 or 2 siblings. Thus far, our model looks like this--with family_id indicating a sibling relationship:
model = lmer(y ~ concordant + age.proband + age.other + sex.proband + sex.proband + sex.other + (1| family_id), data=df2)
is the above formulation sufficient to capture the repeated measures by family? Next, when I do this with lme4a, I get an error: ?Error in lmer(y ~ concordant + age.proband + age.other + sex.proband + ?: ? number of levels of each grouping factor must be less than number of obs I have seen this thread: http://permalink.gmane.org/gmane.comp.lang.r.lme4.devel/3313 but the change does not appear to be included in the latest lme4a package from Rforge, is there another repo where this has been incorporated? or is this an error on my part? thanks, -brent concordant ?family_id ? external_ref.proband ? ?external_ref.other sex.proband sex.other ? age.proband age.other ? y(fake) T ? 58 ?80015550 ? ?80015543 ? ?M ? F ? 15 ?19 ?1 F ? 58 ?80015550 ? ?80016946 ? ?M ? F ? 15 ?8 ? 2 T ? 54 ?80015499 ? ?80015338 ? ?F ? F ? 5 ? 7 ? 3 F ? 54 ?80015499 ? ?80013112 ? ?F ? M ? 5 ? 13 ?4 F ? 22 ?80012269 ? ?80012252 ? ?F ? F ? 12 ?10 ?5 F ? 22 ?80012269 ? ?80018691 ? ?F ? M ? 12 ?8 ? 5
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models