FILENAME goptions URL "http://192.38.117.59/~linearpredictors/datafiles/goptions.sas"; %include goptions; FILENAME url URL "http://192.38.117.59/~linearpredictors/datafiles/readVitaminD.sas"; %include url; /* Different groupings of BMI for use in the tables. */ PROC FORMAT; VALUE weight 0 = "Normal" 1 = "Overweight"; VALUE overweight 0 = "Slight overweight" 1 = "Obese"; RUN; /* The variables "weight" and "overweight" are binary with levels 0,1. The one person with bmi=19.9 is included in weight_group "normal" */ DATA irlwomen; SET irlwomen; weightgroup = 0; IF bmi>=25 THEN weightgroup=1; IF bmi>=25 AND bmi<30 THEN overweight=0; IF bmi>=30 THEN overweight=1; FORMAT weightgroup weight.; FORMAT overweight overweight.; RUN; /* Summary statistics of Vitamin D. */ PROC TABULATE DATA = irlwomen; CLASS weightgroup; VAR vitd; TABLE weightgroup, vitd*(N*(f=4.0) MEAN*(f=6.4)); KEYLABEL N = "Total"; LABEL weightgroup = "BMI group"; RUN; PROC TABULATE DATA = irlwomen; CLASS overweight; VAR vitd; TABLE overweight, vitd*(N*(f=4.0) MEAN*(f=6.4)); KEYLABEL N = "Total"; LABEL overweight = "BMI group"; RUN;