version 5.0 capture log close capture discard log using venndiag.log, replace /* --------------------------------------------------------------------------- Do file "testvenn.do" will create simulated data and figures for STB submission for Venn Diagram routine in "venndiag.ado" Author Jens M.lauritsen, Initiative for Accident Prevention County of Fyn, Denmark. jml@dadlnet.dk. For further explanation: help venndiag Before running this you must: 1. receive venndiag.ado and venndiag.hlp 2. copy venndiag.ado and venndiag.hlp to your ado path (e.g. c:\ado, see: help adopath) 3. Note: This file will create a new file called testdata.dta and clear memory (issue a break if you do not want this) -------------------------------------------------------------------------- */ set more on more clear set display line 100 set log line 100 set textsize 100 * Generate 4000 artificial data points for 4 variables set obs 4000 gen eczema = 0 gen asthma = 0 gen season = 0 gen atopi = 0 replace eczema = 1 in 1326/1599 label data "Simulated testdata for VennDiag" * recode data to make overlapping symptoms: replace asthma = 1 in 1060/1399 replace asthma = . in 1100/1125 replace asthma = 1 in 100/199 replace season = 1 in 200/299 replace season = 1 in 1085/1199 replace season = 1 in 1250/1499 replace season = . in 1200/1225 replace atopi = 1 in 300/399 replace atopi = 1 in 1200/1499 replace atopi = . in 1390/1415 replace atopi = 1 in 1790/1825 replace eczema = 1 in 1800/1999 replace eczema = 1 in 1326/1599 replace eczema = 1 in 1065/1075 replace eczema = . in 1400/1425 label var eczema "Current hand eczema" label var asthma "Asthma previous year" label var season "Seasonal allergic symptoms" label var atopi "Childhood atopic symtptoms" label define yn 0 "No" 1 "Yes" for eczema-atopi: label value @ yn save testdata,replace describe more * no options at all (except saving figure): * Note that all observations with missing are excluded venndiag asthma season eczema, saving(figure1) `1' more push venndiag asthma season eczema, saving(figure1) `1' preserve * count on other variables: recode ec 1=2 recode as 1=3 recode se 1=4 recode at 1=5 * Let us include all records (regarding missing as "NO") venndiag eczema-atopi, saving(figure2) noframe missing t3(Note: 0's shown on graph) `1'/* */ label(all) show(all) t1(Venn Diagram - all information shown on right half of graph) /* */ c1(2) c2(3) c3(4) c4(5) more push venndiag eczema-atopi, saving(figure2) noframe missing t3(Note: 0's shown on graph)/* */ label(all) show(all) t1(Venn Diagram - all information shown on right half of graph) * note that codings will be back as in figure 1 by: restore * now increase size of texts (should be maximum 120) and specify limited information * and generate new variable vd1 set textsize 120 push set textsize 120 venndiag asthma season in 1/3000, saving(figure3) show(xcpt) label(tx)/* */ r1(Allergi related symptoms) r2(A:eczema) gen(vd1) `1'/* */ r3(B:asthma) r4(N=2948) r5(Text: set textsize 120) r6(t1..t3 available for other texts) more push venndiag asthma season in 1/3000, saving(figure3) show(xcpt) label(tx)/* */ r1(Allergi related symptoms) r2(A:eczema) gen(vd1) `1'/* */ r3(B:asthma) r4(N=2948) r5(Text: set textsize 120) r6(t1..t3 available for other texts) set textsize 100 push set textsize 100 d tab vd1 more push tab vd1 * to save the generated variable one must issue a save: save testdata,replace log close /* log file was saved as venndiag.log. For more options etc. try: help venndiag (added to review, press PgUp) */ push help venndiag