[R-sig-ME] Adding Level for non-repeated measurements
|@w|@wt @end|ng |rom gm@||@com
Fri Mar 19 07:41:55 CET 2021
I have a cross-sectional (i.e., non-repeated measurements) dataset from
students ("stud_id") nested within many schools ("sch_id").
The "stud_id" is simply the same as the "row number" for each student (1,
..., n). We know the participating students have been in frequent contact
with each other in each school and thus their scores in their own schools
to varying degrees are correlated.
1- Given above, should we possibly add an additional random-effect for
"stud_id"? If yes, why?
2- Given above, should we also allow residuals in each school (e_ij) to
correlate? If yes, why? (I have a bit of a conceptual problem understanding
this part given the cross-sectional nature of our study.)
# Here is some toy data:
dd <- read.csv("https://raw.githubusercontent.com/hkil/m/master/hs.csv")
lme4::lmer(score ~ 1 + (1 | sch_id / stud_id), data = dd,
control = lmerControl(check.nobs.vs.nRE = "ignore")) # I'm assuming in
lme4 adding "stud_id" as a random-effect by default is not
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models