{smcl} {txt}{sf}{ul off}{.-} name: {res} {txt}log: {res}/Users/thedatacooker/Desktop/Biostat200-2018/Labs-2018/Lab 1/lab 1.smcl {txt}log type: {res}smcl {txt}opened on: {res} 9 Sep 2018, 15:41:27 {txt} {com}. {txt}end of do-file {com}. do "/var/folders/k6/g1qpp_pn0vj37mtyr3qpz65h0000gn/T//SD51156.000000" {txt} {com}. use vct.dta, clear {txt} {com}. {txt}end of do-file {com}. do "/var/folders/k6/g1qpp_pn0vj37mtyr3qpz65h0000gn/T//SD51156.000000" {txt} {com}. describe {txt}Contains data from {res}vct.dta {txt} obs:{res} 3,389 {txt} vars:{res} 13 11 Jul 2018 07:11 {txt} size:{res} 71,169 {txt}{hline} storage display value variable name type format label variable label {hline} {p 0 48}{res}{bind:age }{txt}{bind: double }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:auditc }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:cd4 }{txt}{bind: int }{bind:{txt}%11.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:cd4_cat }{txt}{bind: byte }{bind:{txt}%11.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:female }{txt}{bind: byte }{bind:{txt}%9.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:hiv }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:hungry }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:lastalc }{txt}{bind: byte }{bind:{txt}%20.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:n_adults }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:n_child }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:n_support }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:religion }{txt}{bind: byte }{bind:{txt}%10.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {p 0 48}{bind:sex }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}{p_end} {txt}{hline} Sorted by: {res}hiv {txt} {com}. {txt}end of do-file {com}. do "/var/folders/k6/g1qpp_pn0vj37mtyr3qpz65h0000gn/T//SD51156.000000" {txt} {com}. label var age "Age" {txt} {com}. label var auditc "Audit score, last 3 months" {txt} {com}. label var cd4 "CD4 count" {txt} {com}. label var cd4_cat "CD4 count" {txt} {com}. label var hiv "HIV status" {txt} {com}. label var hungry "How often household members go hungry" {txt} {com}. label var lastalc "Last time used alcohol" {txt} {com}. label var female "female sex" {txt} {com}. label var n_adults "# adults in household" {txt} {com}. label var n_child "# people <18yo in household" {txt} {com}. label var n_support "# people supported financially" {txt} {com}. label var religion "Religion" {txt} {com}. {txt}end of do-file {com}. do "/var/folders/k6/g1qpp_pn0vj37mtyr3qpz65h0000gn/T//SD51156.000000" {txt} {com}. label define yesno 0 "no" 1 "yes" {txt} {com}. label values female yesno {txt} {com}. label define sex 1 "men" 2 "women" {txt} {com}. label values sex sex {txt} {com}. label define hiv 0 "HIV-" 1 "HIV+" {txt} {com}. label values hiv hiv {txt} {com}. label define cd4_cat 0 "<50" 1 "51-250" 2 "251-500" 3 ">500" {txt} {com}. label values cd4_cat cd4_cat {txt} {com}. label define hungry 1 "often" 2 "sometimes" 3 "seldom" 4 "never" {txt} {com}. label values hungry hungry {txt} {com}. label define lastalc 0 "never" 1 ">1 year ago" 2 "within last year" {txt} {com}. label values lastalc lastalc {txt} {com}. label define religion 1 "Protestant" 2 "Catholic" 3 "Saved" 4 "Moslem" 8 "Other" {txt} {com}. label values religion religion {txt} {com}. {txt}end of do-file {com}. do "/var/folders/k6/g1qpp_pn0vj37mtyr3qpz65h0000gn/T//SD51156.000000" {txt} {com}. codebook religion {txt}{hline} {res}religion{right:Religion} {txt}{hline} {col 19}type: numeric ({res}byte{txt}) {ralign 22:label}: {res:religion}, but {res:2} nonmissing values are not labeled {col 18}range: [{res}1{txt},{res}8{txt}]{col 55}units: {res}1 {col 10}{txt}unique values: {res}5{col 51}{txt}missing .: {res}2{txt}/{res}3,389 {txt}{col 13}tabulation: Freq. Numeric Label {col 21}{res} 1,002{col 33} 1{col 43}{txt}Protestant {col 21}{res} 1,047{col 33} 4{col 43}{txt}Moslem {col 21}{res} 576{col 33} 5{col 43} {col 21} 679{col 33} 6{col 43} {col 21} 83{col 33} 8{col 43}{txt}Other {col 21}{res} 2{col 33} .{col 43} {txt} {com}. label list religion {txt}religion: {res} 1 Protestant 2 Catholic 3 Saved 4 Moslem 8 Other {txt} {com}. {txt}end of do-file {com}. do "/var/folders/k6/g1qpp_pn0vj37mtyr3qpz65h0000gn/T//SD51156.000000" {txt} {com}. des {txt}Contains data from {res}vct.dta {txt} obs:{res} 3,389 {txt} vars:{res} 13 11 Jul 2018 07:11 {txt} size:{res} 71,169 {txt}{hline} storage display value variable name type format label variable label {hline} {p 0 48}{res}{bind:age }{txt}{bind: double }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}Age{p_end} {p 0 48}{bind:auditc }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}Audit score, last 3 months{p_end} {p 0 48}{bind:cd4 }{txt}{bind: int }{bind:{txt}%11.0g }{space 1}{bind: }{bind: }{res}{res}CD4 count{p_end} {p 0 48}{bind:cd4_cat }{txt}{bind: byte }{bind:{txt}%11.0g }{space 1}{bind:cd4_cat }{bind: }{res}{res}CD4 count{p_end} {p 0 48}{bind:female }{txt}{bind: byte }{bind:{txt}%9.0g }{space 1}{bind:yesno }{bind: }{res}{res}female sex{p_end} {p 0 48}{bind:hiv }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind:hiv }{bind: }{res}{res}HIV status{p_end} {p 0 48}{bind:hungry }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind:hungry }{bind: }{res}{res}How often household members go hungry{p_end} {p 0 48}{bind:lastalc }{txt}{bind: byte }{bind:{txt}%20.0g }{space 1}{bind:lastalc }{bind: }{res}{res}Last time used alcohol{p_end} {p 0 48}{bind:n_adults }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}# adults in household{p_end} {p 0 48}{bind:n_child }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}# people <18yo in household{p_end} {p 0 48}{bind:n_support }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind: }{bind: }{res}{res}# people supported financially{p_end} {p 0 48}{bind:religion }{txt}{bind: byte }{bind:{txt}%10.0g }{space 1}{bind:religion }{bind: }{res}{res}Religion{p_end} {p 0 48}{bind:sex }{txt}{bind: byte }{bind:{txt}%12.0g }{space 1}{bind:sex }{bind: }{res}{res}{p_end} {txt}{hline} Sorted by: {res}hiv {txt} {com}. sum {txt} Variable {c |} Obs Mean Std. Dev. Min Max {hline 13}{c +}{hline 57} {space 9}age {c |}{res} 3,387 31.72897 9.860256 17.51 79.82 {txt}{space 6}auditc {c |}{res} 3,244 .6390259 1.483416 0 12 {txt}{space 9}cd4 {c |}{res} 999 329.2332 266.1177 1 1932 {txt}{space 5}cd4_cat {c |}{res} 999 1.618619 .9377913 0 3 {txt}{space 6}female {c |}{res} 3,389 .5417527 .4983272 0 1 {txt}{hline 13}{c +}{hline 57} {space 9}hiv {c |}{res} 3,389 .2959575 .4565393 0 1 {txt}{space 6}hungry {c |}{res} 3,321 3.603132 .7817434 1 4 {txt}{space 5}lastalc {c |}{res} 3,377 .9227125 .9101892 0 2 {txt}{space 4}n_adults {c |}{res} 3,384 1.664598 1.737786 0 12 {txt}{space 5}n_child {c |}{res} 3,382 1.850089 1.924868 0 12 {txt}{hline 13}{c +}{hline 57} {space 3}n_support {c |}{res} 3,372 3.907177 3.227549 0 20 {txt}{space 4}religion {c |}{res} 3,387 3.781518 1.994997 1 8 {txt}{space 9}sex {c |}{res} 3,389 1.541753 .4983272 1 2 {txt} {com}. browse {txt} {com}. {txt}end of do-file {com}. do "/var/folders/k6/g1qpp_pn0vj37mtyr3qpz65h0000gn/T//SD51156.000000" {txt} {com}. gen alc_any=0 if auditc==0 {txt}(966 missing values generated) {com}. replace alc_any=1 if auditc>0 & auditc !=. {txt}(821 real changes made) {com}. label var alc_any "Any alcohol use" {txt} {com}. label values alc_any yesno // value label yesno is already part of the dataset {txt} {com}. * check to make sure this worked . tab auditc alc_any, missing {txt}Audit {c |} score, {c |} last 3 {c |} Any alcohol use months {c |} no yes . {c |} Total {hline 11}{c +}{hline 33}{c +}{hline 10} 0 {c |}{res} 2,423 0 0 {txt}{c |}{res} 2,423 {txt} 1 {c |}{res} 0 363 0 {txt}{c |}{res} 363 {txt} 2 {c |}{res} 0 134 0 {txt}{c |}{res} 134 {txt} 3 {c |}{res} 0 118 0 {txt}{c |}{res} 118 {txt} 4 {c |}{res} 0 108 0 {txt}{c |}{res} 108 {txt} 5 {c |}{res} 0 44 0 {txt}{c |}{res} 44 {txt} 6 {c |}{res} 0 13 0 {txt}{c |}{res} 13 {txt} 7 {c |}{res} 0 10 0 {txt}{c |}{res} 10 {txt} 8 {c |}{res} 0 7 0 {txt}{c |}{res} 7 {txt} 9 {c |}{res} 0 15 0 {txt}{c |}{res} 15 {txt} 10 {c |}{res} 0 4 0 {txt}{c |}{res} 4 {txt} 11 {c |}{res} 0 3 0 {txt}{c |}{res} 3 {txt} 12 {c |}{res} 0 2 0 {txt}{c |}{res} 2 {txt} . {c |}{res} 0 0 145 {txt}{c |}{res} 145 {txt}{hline 11}{c +}{hline 33}{c +}{hline 10} Total {c |}{res} 2,423 821 145 {txt}{c |}{res} 3,389 {txt} {com}. {txt}end of do-file {com}. do "/var/folders/k6/g1qpp_pn0vj37mtyr3qpz65h0000gn/T//SD51156.000000" {txt} {com}. drop alc_any {txt} {com}. recode auditc (0=0 "no") (2/max=1 "yes"), gen(alc_any) {txt}(458 differences between auditc and alc_any) {com}. label var alc_any "Any alcohol use" {txt} {com}. {txt}end of do-file {com}. do "/var/folders/k6/g1qpp_pn0vj37mtyr3qpz65h0000gn/T//SD51156.000000" {txt} {com}. recode auditc (min/2=0 "no") (3/max=1 "yes"), gen(alc_unh) {txt}(821 differences between auditc and alc_unh) {com}. replace alc_unh = 0 if female==0 & auditc==3 {txt}(69 real changes made) {com}. label var alc_unh "Unhealthy alcohol use" {txt} {com}. * check to make sure this worked . bysort female: tab auditc alc_unh, m {txt}{hline} -> female = no Audit {c |} score, {c |} last 3 {c |} Unhealthy alcohol use months {c |} no yes . {c |} Total {hline 11}{c +}{hline 33}{c +}{hline 10} 0 {c |}{res} 1,042 0 0 {txt}{c |}{res} 1,042 {txt} 1 {c |}{res} 166 0 0 {txt}{c |}{res} 166 {txt} 2 {c |}{res} 57 0 0 {txt}{c |}{res} 57 {txt} 3 {c |}{res} 69 0 0 {txt}{c |}{res} 69 {txt} 4 {c |}{res} 0 71 0 {txt}{c |}{res} 71 {txt} 5 {c |}{res} 0 34 0 {txt}{c |}{res} 34 {txt} 6 {c |}{res} 0 9 0 {txt}{c |}{res} 9 {txt} 7 {c |}{res} 0 8 0 {txt}{c |}{res} 8 {txt} 8 {c |}{res} 0 5 0 {txt}{c |}{res} 5 {txt} 9 {c |}{res} 0 12 0 {txt}{c |}{res} 12 {txt} 10 {c |}{res} 0 2 0 {txt}{c |}{res} 2 {txt} 11 {c |}{res} 0 2 0 {txt}{c |}{res} 2 {txt} 12 {c |}{res} 0 2 0 {txt}{c |}{res} 2 {txt} . {c |}{res} 0 0 74 {txt}{c |}{res} 74 {txt}{hline 11}{c +}{hline 33}{c +}{hline 10} Total {c |}{res} 1,334 145 74 {txt}{c |}{res} 1,553 {txt}{hline} -> female = yes Audit {c |} score, {c |} last 3 {c |} Unhealthy alcohol use months {c |} no yes . {c |} Total {hline 11}{c +}{hline 33}{c +}{hline 10} 0 {c |}{res} 1,381 0 0 {txt}{c |}{res} 1,381 {txt} 1 {c |}{res} 197 0 0 {txt}{c |}{res} 197 {txt} 2 {c |}{res} 77 0 0 {txt}{c |}{res} 77 {txt} 3 {c |}{res} 0 49 0 {txt}{c |}{res} 49 {txt} 4 {c |}{res} 0 37 0 {txt}{c |}{res} 37 {txt} 5 {c |}{res} 0 10 0 {txt}{c |}{res} 10 {txt} 6 {c |}{res} 0 4 0 {txt}{c |}{res} 4 {txt} 7 {c |}{res} 0 2 0 {txt}{c |}{res} 2 {txt} 8 {c |}{res} 0 2 0 {txt}{c |}{res} 2 {txt} 9 {c |}{res} 0 3 0 {txt}{c |}{res} 3 {txt} 10 {c |}{res} 0 2 0 {txt}{c |}{res} 2 {txt} 11 {c |}{res} 0 1 0 {txt}{c |}{res} 1 {txt} . {c |}{res} 0 0 71 {txt}{c |}{res} 71 {txt}{hline 11}{c +}{hline 33}{c +}{hline 10} Total {c |}{res} 1,655 110 71 {txt}{c |}{res} 1,836 {txt} {com}. {txt}end of do-file {com}. do "/var/folders/k6/g1qpp_pn0vj37mtyr3qpz65h0000gn/T//SD51156.000000" {txt} {com}. graph box n_support, over(hungry) name(ins_alc, replace) {res}{txt} {com}. {txt}end of do-file {com}. exit, clear