************************************************************************** * * * hivnet.do * * * * PURPOSE: analysis of willingness at month=6 among ICgroup=1 * * subjects, and whether willingness depends on knowledge * * or change in knowledge * * * * DATE: 14 April 2002 * * * ************************************************************************** infile will6 know6 group educ cohort age q4safe6 will0 know0 q4safe0 using hivnet.dat *** *** recode and label variables *** gen knowhigh = know6 recode knowhigh min/7=0 8/max=1 gen msm = group recode msm 2/4=0 gen school = educ recode school 1/2=0 3/6=1 label variable will6 "willingness" label variable knowhigh "knowledge high" 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 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 will6 ylab label values knowhigh klab label values msm glab label values cohort clab label values school slab *** *** univariate summaries *** tabulate will6 tabulate knowhigh tabulate cohort *** *** bivariate summaries *** tabulate knowhigh will6 tabulate cohort will6 tabulate cohort knowhigh ********** see Notes p. 155 ********** table knowhigh, c(mean will6) f(%5.2f) table cohort, c(mean will6) f(%5.2f) table cohort, c(mean knowhigh) f(%5.2f) table knowhigh will6, by(cohort) row col table knowhigh, by(cohort) row c(mean will6) f(%5.2f) *** *** risk difference and ratio summaries *** cs will6 knowhigh cs will6 knowhigh, by(cohort) *** *** odds ratio summaries *** ********** see Notes p. 169-1 ********** cc will6 knowhigh cc will6 knowhigh, by(cohort) *** *** using logistic regression *** ********** see Notes p. 169-2 ********** logistic will6 knowhigh logit logistic will6 knowhigh cohort logit xi: logistic will6 i.knowhigh*i.cohort logit *** *** let's compare Mantel-Haenszel to logistic regression *** cc will6 knowhigh, by(cohort) bd