version 11 set more on log using 11.5.Isoproterenol.log, replace * 11.5.Isoproterenol.log * * Perform a response feature analysis of the effect of race and dose of * isoproterenol on blood flow using the data of Lang et al. (1995). For * each patient, we will perform separate linear regressions of change in * blood flow against log dose of isoproterenol. The response feature that * we will use is the slope of each individual regression curve. * use C:\WDDtext\11.2.Long.Isoproterenol.dta, clear * * Calculate the regression slope for the first patient * regress delta_fbf logdose if id == 1 predict yhat scatter delta_fbf dose if dose!=0 & id==1 /// || line yhat dose if dose!=0 & id==1 /// , ylabel(0 5 10 15 20 25) /// ytitle(Change in Forearm Blood Flow) xscale(log) /// xlabel(10 20 30 60 100 150 200 300 400, angle(45)) /// xmtick(10(10)90 250 350) legend(off) more * Calculate regression slopes for each patient. * Reduce data set to one record per patient. * The variable slope contains the regression slopes; race * is included in the by option of the statsby command to to * keep this variable in the data file. * statsby _b, by(id race) clear : regress delta_fbf logdose list id _b_logdose race stripplot _b_logdose, over(race) boffset(-0.2) ysize(2) /// box(lwidth(medthick) barwidth(0.2)) /// scale(2.5) yscale(titlegap(-8)) /// xtitle(Slope: Change in Blood Flow per Unit Change in Log Dose) more * * Do ranksum test on slopes. * ranksum _b_logdose, by(race) more * * Do t tests comparing change in blood flow in blacks and whites at * different doses * use C:\WDDtext\11.2.Long.Isoproterenol.dta, clear sort dose drop if dose==0 by dose: ttest delta_fbf , by(race) unequal log close