window push version 11.0 window push set more on window push log using 11.2.Isoproterenol.log, replace window push * 11.2.Isoproterenol.log window push * window push * Plot mean forearm blood flow by race and log dose of isoproternol window push * using the data of Lang et al. (1995). Show standard deviation for window push * each race at each drug level. window push * window push use C:\wddtext\11.2.Isoproterenol.dta, clear window push table race, row window push list if id==1 | id ==22 window push generate baseline = fbf0 window push * window push * Convert data from one record per patient to one record per observation. window push * window push more window push reshape long fbf, i(id) j(dose) window push list if id==1 | id ==22 window push generate delta_fbf = fbf-baseline window push label variable delta_fbf "Change in Forearm Blood Flow" window push label variable dose "Isoproterenol Dose (ng/min)" window push generate plotdose = dose window push replace plotdose=6 if dose == 0 window push label variable plotdose "Isoproterenol Dose (ng/min)" window push generate logdose = log(dose) window push label variable logdose "Log Isoproterenol Dose" window push * window push * Save long format of data for subsequent analyses window push * window push save C:\wddtext\11.2.Long.Isoproterenol.dta, replace window push * window push * Generate Figure 11.1 window push * window push more window push collapse (mean) fbfbar=fbf (sd) sd=fbf, by(race plotdose) window push generate blackfbf = . window push generate whitefbf = . window push generate whitesd = . window push generate blacksd = . window push replace whitefbf = fbfbar if race==1 window push replace blackfbf = fbfbar if race==2 window push replace blacksd = sd if race==2 window push replace whitesd = sd if race==1 window push label variable whitefbf "Forearm Blood Flow (ml/min/dl)" window push label variable blackfbf "Forearm Blood Flow (ml/min/dl)" window push generate wsdbar = whitefbf-whitesd window push generate bsdbar = blackfbf-blacksd window push replace wsdbar = whitefbf+ whitesd if plotdose < 20 window push more window push twoway connected whitefbf plotdose, color(red) /// window push || rcap whitefbf wsdbar plotdose, color(red) /// window push || connected blackfbf plotdose, color(blue) /// window push || rcap blackfbf bsdbar plotdose, color(blue) /// window push ||, ytitle(Forearm Blood Flow (ml/min/dl)) /// window push legend(ring(0) position(11) col(1) order(1 "Whites" 3 "Blacks")) /// window push xtitle(Isoproterenol Dose (ng/min)) xscale(log) /// window push xlabel(6 "0" 10 20 30 60 100 150 200 300 400, angle(45)) /// window push xmtick(40(10)90 250 350) window push more window push * window push * Plot individual responses for white and black patients window push * window push use C:\wddtext\11.2.Long.Isoproterenol.dta, clear window push sort id plotdose window push twoway connected fbf plotdose, connect(L) xscale(log) /// window push xlabel(6 "0" 10 20 30 60 100 150 200 300 400, angle(45)) /// window push xmtick(40(10)90 250 350) ylabel(0(5)40, angle(0)) /// window push ytitle(Forearm Blood Flow (ml/min/dl)) by(race) window push log close