I couldn't stand it any longer...I decided to play with R on this for a couple of minutes...
Maybe a poor proof of concept, if you can call it that?
Code:
## install packages
install.packages("lme4"); install.packages("plyr")
library(lme4); library(plyr)
## simulate data ##
df<-data.frame(ind_id=rep(1:11, c(3,4,2,3,2,5,3,2,2,1,7)), educ=rep(sample(1:4,11,replace=T), c(3,4,2,3,2,5,3,2,2,1,7)))
df<-ddply(df, .(ind_id), transform, offense_num=seq(1,length(ind_id),1))
df$offense_grade<-df$offense_num # assume that employees get demerits in sequence (1-7)
hist(df$offense_grade) ## all individuals combined
## GLMM (haven't thought about this too much...might be wrong ##
mod <- lmer(offense_grade ~ educ + (1|ind_id), family=poisson (link="log"), data=df)
summary(mod)
## Just for those who want to change the dataset above and examine residuals, etc. ###
par(mfrow=c(2,2))
plot(predict(mod), resid(mod)); abline(h=0)
hist(resid(mod))
qqnorm(resid(mod))
Last edited: