## Not run:
# data(MSCMsub)
# mydata=MSCMsub
#
# #MSCM stduy data layout requires some arrangement for model fitting.
#
# N=167
# nt=4
# nr=2
#
# yvec=matrix(0,N*nt*nr,1)
# xmat=matrix(0,N*nt*nr,8)
#
# for(i in 1:N) {
# for(j in 1:nt){
# yvec[j+(i-1)*nr*nt]=mydata[j+(i-1)*nt,2]
# yvec[j+(i-1)*nr*nt+nt]=mydata[j+(i-1)*nt,3]
# }
# }
#
# for(i in 1:N) {
# for(j in 1:nt){
# for(k in 4:11){
# xmat[j+(i-1)*nr*nt,(k-3)]=mydata[j+(i-1)*nt,k]
# xmat[j+(i-1)*nr*nt+nt,(k-3)]=mydata[j+(i-1)*nt,k]
# }
# }
# }
#
# id=rep(1:N, each=(nt*nr))
# mydatanew=data.frame(id,yvec,xmat)
# head(mydatanew)
# colnames(mydatanew)=c("id","resp","chlth","csex","education","employed",
# "housize","married","mhlth","race")
# head(mydatanew)
#
# formulaj1=resp~chlth+csex+education+employed+housize+married+
# mhlth+race
#
# fitjgee1=JGee1(formula=formulaj1,id=mydatanew[,1],data=mydatanew, nr=2,
# na.action=NULL, family=binomial(link="logit"), corstr1="exchangeable",
# Mv=NULL, corstr2="independence", beta_int=NULL, R1=NULL, R2=NULL,
# scale.fix= FALSE, scale.value=1, maxiter=25, tol=10^-3,
# silent=FALSE)
#
# summary(fitjgee1)
#
# names(summary(fitjgee1))
#
# summary(fitjgee1)$working.correlation1
# ## End(Not run)
Run the code above in your browser using DataLab