data(mscm)
coefnames<-c("intercept","married","education",
"employed","chlth","mhlth","race","csex","housize",
"bstress","billness","week","resptype","married*resptype",
"education*resptype","employed*resptype","chlth*resptype",
"mhlth*resptype","race*resptype","csex*resptype",
"housize*resptype","bstress*resptype","billness*resptype",
"week*resptype")
# mmm2 automatically assign 0 to response type indicator
# variable for response=stress and 1 to it for response=illness
mmm2.fit<-mmm2(data=mscm,nresp=2,interaction=seq(1:11),coefnames=coefnames,
family=binomial(link=logit), corstr="exchangeable")
round(summary(mmm2.fit)$coef,3)
Run the code above in your browser using DataLab