# NOT RUN {
#
# Examine the multilevel properties of work hours and well-being
# in the bh1996 data
#
data(bh1996)
with(bh1996,waba(HRS,WBEING,GRP))
mult.icc(bh1996[,c("HRS","WBEING")],bh1996$GRP)
#
#Estimate true group-mean correlation by adding ICC2 adjusted incremental
#correlation back to within correlation. For value of -.8256
#
-0.110703+(-0.7121729--0.110703)/(sqrt(0.9171286*0.771756))
#
# Simulate data with same properties assuming no measurement error
#
set.seed(578323)
SIM.ML.COR<-sim.mlcor(gsize=75,ngrp=99,gcor=-.8256,wcor=-.1107,
icc1x=0.04338,icc1y=0.12924,alphax=1,alphay=1)
#
# Compare Simulated results to results (above) from bh1996
#
with(SIM.ML.COR,waba(X,Y,GRP))
mult.icc(SIM.ML.COR[,c("X","Y")],SIM.ML.COR$GRP)
# }
Run the code above in your browser using DataLab