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; /* Women from Ireland and Poland */ PROC FORMAT; VALUE bmigroupf 0 = "Normal weight" 1 = "Over weight"; RUN; DATA irpo; SET vitamind (WHERE = (country in (4,6) and category=2)); if bmi > 0 then bmigroup = 0; if bmi >= 25 then bmigroup = 1; logvitd=log10(vitd); RUN; title 'The four simple logarithmic averages'; proc tabulate data=irpo; CLASS country bmigroup; var logvitd; table country,(bmigroup*logvitd)*(mean*(f=8.3) N*(f=5.0)); format country countryf.; format bmigroup bmigroupf.; run; title 'Estimation of differences'; PROC GLM DATA=irpo; CLASS country bmigroup; MODEL logvitd = country bmigroup country*bmigroup; format country countryf.; format bmigroup bmigroupf.; estimate 'Ireland minus Poland, Normal weight' country 1 -1 country*bmigroup 1 0 -1 0; estimate 'Ireland minus Poland, Over weight' country 1 -1 country*bmigroup 0 1 0 -1; estimate 'Over weight minus Normal weight, Poland' bmigroup 1 -1 country*bmigroup 0 0 1 -1; estimate 'Over weight minus Normal weight, Ireland' bmigroup 1 -1 country*bmigroup 1 -1 0 0; estimate 'Difference between differences' country*bmigroup -1 1 1 -1; RUN;