-------------------------------------------------------------------------------------------------------- name: log: C:\MyDocs\MPH\LectureNotes\ClassDoLogData\Analysis of Variance\11.5.Isoproterenol.log log type: text opened on: 30 Apr 2010, 09:06:25 . * 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 Source | SS df MS Number of obs = 6 -------------+------------------------------ F( 1, 4) = 71.86 Model | 570.114431 1 570.114431 Prob > F = 0.0011 Residual | 31.7339077 4 7.93347694 R-squared = 0.9473 -------------+------------------------------ Adj R-squared = 0.9341 Total | 601.848339 5 120.369668 Root MSE = 2.8166 ------------------------------------------------------------------------------ delta_fbf | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- logdose | 7.181315 .8471392 8.48 0.001 4.82928 9.533351 _cons | -14.82031 3.860099 -3.84 0.018 -25.53767 -4.10296 ------------------------------------------------------------------------------ . predict yhat (option xb assumed; fitted values) (22 missing values generated) . 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 (running regress on estimation sample) command: regress delta_fbf logdose by: id race Statsby groups ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 ...................... . list id _b_logdose race +-----------------------+ | id _b_log~e race | |-----------------------| 1. | 1 7.181315 White | 2. | 2 6.539237 White | 3. | 3 3.999704 White | 4. | 4 4.665485 White | 5. | 5 4.557809 White | |-----------------------| 6. | 6 6.252436 White | 7. | 7 2.385183 White | 8. | 8 8.354769 White | 9. | 9 9.590916 White | 10. | 10 6.515281 White | |-----------------------| 11. | 11 3.280572 White | 12. | 12 3.434072 White | 13. | 13 5.004545 White | 14. | 14 .5887727 Black | 15. | 15 1.828892 Black | |-----------------------| 16. | 16 .3241574 Black | 17. | 17 1.31807 Black | 18. | 18 1.630882 Black | 19. | 19 .7392463 Black | 20. | 20 2.513615 Black | |-----------------------| 21. | 21 1.031773 Black | 22. | 22 4.805952 Black | +-----------------------+ . 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) Two-sample Wilcoxon rank-sum (Mann-Whitney) test race | obs rank sum expected -------------+--------------------------------- White | 13 201 149.5 Black | 9 52 103.5 -------------+--------------------------------- combined | 22 253 253 unadjusted variance 224.25 adjustment for ties -0.00 ---------- adjusted variance 224.25 Ho: _b_log~e(race==White) = _b_log~e(race==Black) z = 3.439 Prob > |z| = 0.0006 . 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 (22 observations deleted) . by dose: ttest delta_fbf , by(race) unequal -------------------------------------------------------------------------------------------------------- -> dose = 10 Two-sample t test with unequal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- White | 12 .7341667 .3088259 1.069804 .0544455 1.413888 Black | 9 .3966667 .2071634 .6214902 -.081053 .8743863 ---------+-------------------------------------------------------------------- combined | 21 .5895238 .1967903 .9018064 .1790265 1.000021 ---------+-------------------------------------------------------------------- diff | .3375 .3718737 -.4434982 1.118498 ------------------------------------------------------------------------------ diff = mean(White) - mean(Black) t = 0.9076 Ho: diff = 0 Satterthwaite's degrees of freedom = 18.0903 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.8120 Pr(|T| > |t|) = 0.3760 Pr(T > t) = 0.1880 -------------------------------------------------------------------------------------------------------- -> dose = 20 Two-sample t test with unequal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- White | 12 3.775833 .6011875 2.082575 2.452628 5.099038 Black | 9 1.03 .3130229 .9390686 .308168 1.751832 ---------+-------------------------------------------------------------------- combined | 21 2.599048 .4719216 2.162616 1.614636 3.583459 ---------+-------------------------------------------------------------------- diff | 2.745833 .6777977 1.309989 4.181677 ------------------------------------------------------------------------------ diff = mean(White) - mean(Black) t = 4.0511 Ho: diff = 0 Satterthwaite's degrees of freedom = 16.1415 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.9995 Pr(|T| > |t|) = 0.0009 Pr(T > t) = 0.0005 -------------------------------------------------------------------------------------------------------- -> dose = 60 Two-sample t test with unequal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- White | 13 11.94308 1.7667 6.369927 8.093769 15.79239 Black | 9 3.121111 .606757 1.820271 1.721927 4.520295 ---------+-------------------------------------------------------------------- combined | 22 8.334091 1.41675 6.645146 5.387798 11.28038 ---------+-------------------------------------------------------------------- diff | 8.821966 1.867989 4.83314 12.81079 ------------------------------------------------------------------------------ diff = mean(White) - mean(Black) t = 4.7227 Ho: diff = 0 Satterthwaite's degrees of freedom = 14.6912 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.9999 Pr(|T| > |t|) = 0.0003 Pr(T > t) = 0.0001 -------------------------------------------------------------------------------------------------------- -> dose = 150 Two-sample t test with unequal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- White | 12 14.5675 2.315375 8.020693 9.471395 19.66361 Black | 9 4.053333 .6509929 1.952979 2.552141 5.554526 ---------+-------------------------------------------------------------------- combined | 21 10.06143 1.76385 8.082978 6.382101 13.74076 ---------+-------------------------------------------------------------------- diff | 10.51417 2.405151 5.305596 15.72274 ------------------------------------------------------------------------------ diff = mean(White) - mean(Black) t = 4.3715 Ho: diff = 0 Satterthwaite's degrees of freedom = 12.6988 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.9996 Pr(|T| > |t|) = 0.0008 Pr(T > t) = 0.0004 -------------------------------------------------------------------------------------------------------- -> dose = 300 Two-sample t test with unequal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- White | 12 17.5175 2.130898 7.381646 12.82743 22.20757 Black | 9 6.875556 1.301472 3.904415 3.874357 9.876754 ---------+-------------------------------------------------------------------- combined | 21 12.95667 1.761875 8.073924 9.281461 16.63187 ---------+-------------------------------------------------------------------- diff | 10.64194 2.496909 5.383291 15.9006 ------------------------------------------------------------------------------ diff = mean(White) - mean(Black) t = 4.2620 Ho: diff = 0 Satterthwaite's degrees of freedom = 17.4068 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.9997 Pr(|T| > |t|) = 0.0005 Pr(T > t) = 0.0003 -------------------------------------------------------------------------------------------------------- -> dose = 400 Two-sample t test with unequal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- White | 13 21.69308 2.163637 7.801104 16.97892 26.40724 Black | 9 5.586667 1.80355 5.410649 1.427673 9.74566 ---------+-------------------------------------------------------------------- combined | 22 15.10409 2.252517 10.56524 10.41972 19.78846 ---------+-------------------------------------------------------------------- diff | 16.10641 2.816756 10.2306 21.98222 ------------------------------------------------------------------------------ diff = mean(White) - mean(Black) t = 5.7181 Ho: diff = 0 Satterthwaite's degrees of freedom = 19.9917 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000 . log close name: log: C:\MyDocs\MPH\LectureNotes\ClassDoLogData\Analysis of Variance\11.5.Isoproterenol.log log type: text closed on: 30 Apr 2010, 09:07:09 --------------------------------------------------------------------------------------------------------