I am having some trouble setting up a G-study for the following data":
rater<- rep(1:4,each=12)
stu <- rep(1:8,each=6)
item<-rep(1:6,8)
score<- sample(2:4,48,replace=T)
dat<-as.data.frame(cbind(rater,stu,item,score))
Students are crossed with items and nested in raters. I am assuming these effects are random for the time being. I don't know how to write the regression formula.
I have tried the following formulas
library(gtheory)
gstudy(dat, score~(1|rater/stu:item))
gstudy(dat,score~(1|rater/item:stu))
I keep getting an error message:
Error: the number of levels of each grouping factor must be < number of observations.
I am unsure if there are other parameters that need to be set within the gstudy
function.
To summarize, I have two questions:
- How do you write the formula for students crossed with items and nested in raters?
- Are there additional parameters that I need to include in the
gstudy
function?
P.S.: I have not used this gtheory package before.