**Setup cd "/Users/kristenaiemjoy/Box Sync/_Teaching/Biostat 212/Biostat212.2018/Assignments/Assignment 3" //modify filepath to your directory capture log close //close any open log files clear quietly log using biostat212_assignment3_key.smcl, replace /*using "quietly" will stop print out in your smcl file making a nicer looking .pdf when you use markdown*/ /*** #Biostat 212: 2018 #Assignment 3: Data visualization ## Your Name --- Instructions For each graph, follow the instructions step by step. Include your command under each step. If you get stuck, explore the drop-down menu and copy-paste commands into your .do file. The Stata help files are also useful. Include the final graph in the MarkDoc document. Turn in the docx or pdf you create using MarkDoc. See the first graph (Histogram) for an example 35 pts total ***/ /*** ##Open data set Load the nhanes2 data set from the web ***/ /*** ##HISTOGRAM ***/ /*** Create a histogram of systolic blood pressure (bpsystol) ***/ histogram bpsystol /*** Plot frequency instead of density ***/ histogram bpsystol, frequency /*** Overlay a normal distribution ***/ histogram bpsystol, frequency normal /*** Change the number of bins to 15 ***/ histogram bpsystol, frequency normal bin(15) /*** Change the scheme too (s1mono) ***/ histogram bpsystol, frequency normal bin(15) scheme(s1mono) /*** Display the final plot in your MarkDoc document ***/ img /*** ##BAR CHART [+10] ***/ /*** Create a bar plot (bar chart) of heart attack ***/ /*** Create and assign a label for (heartatk) 0 = no heart attack 1= heart attack and re-run your bar plot ***/ /*** Now plot mean heart attack over sex ***/ /*** Add diabetes to your plot (mean heart attack and diabetes over sex) ***/ /*** Add a clearly-worded legend _hint: legend( label(1 "xyz") label(2 "xyz") )_ ***/ /*** Add an informative title and a note with the data source _hint: note("Source: NHANES")_ ***/ /*** Produce the same figure, but only for people 70 years old and older add a subtitle describing the sub-population ***/ /***change the color of the heart attack bar to black and the color of the diabetes bar to gray _hint: bar(1, color(black)) bar(2, color(gray)) _ ***/ /***Change the graph region color from light blue to white ***/ /*** Display the final plot in your markDoc document ***/ /*** ##SCATTER PLOT [+10] ***/ /*** Create a scatter plot of systolic blood pressure and age ***/ /*** Change the point size to very tiny and the color to gray ***/ /*** Add a black dashed linear fit line ***/ /*** Change the line width to thick ***/ /*** Turn off the legend ***/ /*** Add a y-axis title (Systolic blood pressure) ***/ /*** Change the scheme to (s1color) ***/ /*** Display the final plot in your MarkDoc document ***/ /*** ##YOUR CHOICE [+15] Visualize 2 or 3 variables in the dataset in a single plot. Use any type of plot. Add clear labels to make it easy for the reader to understand your plot. Add a title and a note with the data source. Consider using a scheme or change the colors from the default (S2mono). Include the code and the plot in your MarkDoc document ***/ qui log close //close log (quietly so it won't appear in markdown document **Generate MarkDoc (html, docX, or PDF) markdoc biostat212_assignment3_name, replace statax export(html)