/************************************* This program produces \ref{tab: vitD-ch1intro-bmi} **************************************/ cap log close clear log using StataLog, replace include "http://192.38.117.59/~linearpredictors/datafiles/readVitaminD.do" use "`irlwomen'" generate weightgroup = "" generate overweight = "" replace weightgroup = "Normal" if bmi >= float(19.9) & bmi < 25 replace weightgroup = "Overweight" if bmi >=25 & !missing(bmi) replace overweight = "Slight owerweight" if bmi >= 25 & bmi<30 replace overweight = "Obese" if bmi >= 30 & !missing(bmi) /************************************* Summary statistics of Vitamin D We put the single person with bmi=19.9 in the group 'normal weight'. The variables "weight" and "overweight" are binary with levels 0,1. **************************************/ tabulate weightgroup, summarize(vitd) tabulate overweight, summarize(vitd) log close