** Biostat 212: Lecture 2 Exploring *Lab 2: live coding demo *August 1, 2017 ******************* *Set up ******************* clear all //clear any open data sets pwd //check working directory cd "/Users/kristenaiemjoy/Box Sync/_Teaching/Biostat 212/Biostat212.2017/Labs/Lab 2. Exploring" //changes working directory capture log close //closes anyu log files that are open log using lab2.smcl, replace //opens a log file webuse nhanes2 //download nhanesd dataset from stata website *************************** **how many observations are there? count describe des, short //shorthand **** ds //see full variable name codebook sizplace **listing list heartatk in 1/10 list sex bmi heartatk in -50/l //lists last 50 in results window **versus browse browse sex bmi heartatk in -50/l br //shorthand **sort gsort- heartatk -age br list age in 1/3 list age in -10/l **look at missing heart attacks tab heartatk, missing ***what percent of females had a heart attack tab sex heartatk, row tab heartatk sex, col tab sex heartatk if age>70, row