********************************************************************** * File: BMI analysis.do * Task: Compare the mean BMI to a hypothesis of 24.5. * Author: Erik Parner. 14-1-2015. ********************************************************************** * Change the directory. cd "D:\Teaching\BasicBiostat\Examples\BMI" * Close the log file, if there is one open. capture log close * Start a new log file. log using "BMI analysis.log" ,text replace * Read the data. use bmiwomen.dta,clear * Checking if the data follows a normal distribution using * a QQ plot. qnorm bmi * Student's t-test for the hypothesis: Mean BMI = 24.5 ttest bmi=24.5 * Close the log file. log close