************************************************************** * HivnetIC-glmm.do * ************************************************************** * * * PURPOSE: analysis of HIVNET Informed Consent Data * * * * AUTHOR: P. Heagerty * * * * DATE: 10 May 2005 * ************************************************************** infile id group education age cohort ICgroup will0 know0 /// q4safe0 q4safe6 q4safe12 /// nurse0 nurse6 nurse12 using HivnetWide.dat *** *** recode and label variables *** gen knowhigh = know0 recode knowhigh min/7=0 8/max=1 gen knowbins = know0 recode knowbins min/0=0 1/3=1 4/6=2 7/max=3 gen msm = group recode msm 2/4=0 gen school = education recode school 1/2=0 3/6=1 gen agecat = age recode agecat min/29=0 30/39=1 40/max=2 label variable will0 "willingness" label variable knowhigh "knowledge high" label variable knowbins "knowledge level" label variable msm "risk group" label variable cohort "recruitment cohort" label variable school "education" label define ylab 0 "< def. willing" 1 "definitely willing" label define klab 0 "know6 <=7" 1"know6 >=8" label define klab2 0 "know6 <=0" 1 "know6 (1-3)" 2 "know6 (4-6)" 3 "know6 (7-10)" label define glab 0 "IDU+Women" 1 "MSM" label define clab 0 "old cohort" 1 "new cohort" label define slab 0 "<= high school" 1 "some college +" label values will0 ylab label values knowhigh klab label values msm glab label values cohort clab label values school slab ****************************************************************** *** create "long" format data *** ****************************************************************** reshape long q4safe, i(id) j(month) list id q4safe month ICgroup education in 1/8 ****************************************************************** *** GEE Analysis *** ****************************************************************** gen month6 = (month==6) gen ICgroupXmonth6 = month6 * ICgroup gen month12 = (month==12) gen ICgroupXmonth12 = month12 * ICgroup *** [1] Baseline and Month 6 Only xtgee q4safe ICgroup month6 ICgroupXmonth6 if month<=6, /// i(id) corr(exchangeable) family(binomial) link(logit) robust *** [2] Baseline, Month 6, and Month 12 ***alternative parameterization gen post = (month>0) gen ICgroupXpost = post * ICgroup xtgee q4safe ICgroup post month12 ICgroupXpost ICgroupXmonth12, /// i(id) corr(unstructured) t(month) family(binomial) link(logit) robust ****************************************************************** *** Conditional Logistic Regression Analysis *** ****************************************************************** *** [1] Baseline and Month 6 Only clogit q4safe ICgroup month6 ICgroupXmonth6 if month<=6, strata(id) *** [2] Baseline, Month 6, and Month 12 clogit q4safe ICgroup post month12 ICgroupXpost ICgroupXmonth12, strata(id) ****************************************************************** *** Logistic-Normal (GLMM) Regression Analysis *** ****************************************************************** xtlogit q4safe ICgroup month6 ICgroupXmonth6 if month<=6, i(id) quad(20) *** [2] Baseline, Month 6, and Month 12 xtlogit q4safe ICgroup post month12 ICgroupXpost ICgroupXmonth12, /// i(id) quad(20)