1 / 68

BS704 Class 8 Analysis of Variance

BS704 Class 8 Analysis of Variance. HW Set #7. Chapter 7 Problems 5, 14, 19 and 28 R Problem Set 7 (on Blackboard) Due November 2 Please complete Quiz 9 Before Nov 2. An RCT to Assess the Efficacy of a New Drug for Asthma in Children. Background characteristics Age Sex

leyna
Télécharger la présentation

BS704 Class 8 Analysis of Variance

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BS704 Class 8Analysis of Variance

  2. HW Set #7 Chapter 7 Problems 5, 14, 19 and 28 R Problem Set 7 (on Blackboard) Due November 2 Please complete Quiz 9Before Nov 2

  3. An RCT to Assess the Efficacy of a New Drug for Asthma in Children • Background characteristics • Age • Sex • Years since diagnosis of asthma • Outcomes • Self-reported improvement in symptoms • FEV1

  4. Did the randomization work? • Yes • No Characteristic Placebo New Drug p Age, years 10 (2.4) 9.9 (2.1) .76 % Male 54% 43% .04 Yrs since Dx 3.4 (1.9) 3.1 (2.1) .34

  5. What are hypotheses to compare ages? • H0:m1=m2 vs H1:m1≠m2 • H0:p1=p2 vs H1:p1≠p2 • H0:m=10 vs H1:m≠10 • H0:md=0 vs H1:md≠0 Characteristic Placebo New Drug p Age, years 10 (2.4) 9.9 (2.1) .76 % Male 54% 43% .04 Yrs since Dx 3.4 (1.9) 3.1 (2.1) .34

  6. What test would be used to compare % improvement between groups? • Test for equality of means • Test for equality of proportions • Test for mean difference • No clue

  7. What test would be used to compare FEV1 between groups? • Test for equality of means • Test for equality of proportions • Test for mean difference • No clue

  8. Objectives • Understand the procedure for testing the equality of k > 2 means • Perform the test by hand and using R • Appropriately interpret results

  9. Hypothesis Testing Procedures 1. Set up null and research hypotheses, select a 2. Select test statistic 3. Set up decision rule 4. Compute test statistic 5. Draw conclusion & summarize significance (p-value)

  10. Hypothesis Testing for More than 2 Means - Analysis of Variance • Continuous outcome • k Independent Samples, k > 2 H0: m1=m2=m3 … =mk H1: Means are not all equal Test Statistic (Find critical value in Table 4)

  11. Test Statistic - F Statistic • Comparison of two estimates of variability in data • Between treatment variation, is based on the assumption that H0 is true (i.e., population means are equal) • Within treatment, Residual or Error variation, is independent of H0 (i.e., we do not assume that the population means are equal and we treat each sample separately)

  12. F Statistic Difference BETWEEN each group mean and overall mean Difference between each observation and its group mean (WITHIN group variation - ERROR)

  13. F Statistic F = MSB/MSE MS = Mean Square What values of F that indicate H0 is likely true?

  14. Decision Rule Reject H0 if F > Critical Value of F with df1=k-1 and df2=N-k from Table 4 k= # comparison groups N=Total sample size

  15. ANOVA Table Source of Sums of Mean Variation Squares df Squares F Between Treatments k-1 SSB/k-1 MSB/MSE Error N-k SSE/N-k Total N-1

  16. Example Is there a significant difference in mean weight loss among 4 different diet programs? (Data are pounds lost over 8 weeks)

  17. Example Summary Statistics on Weight Loss by Treatment Low-Cal Low-Fat Low-Carb Control n 5 5 5 5 Mean 6.6 3.0 3.4 1.2 Overall Mean = 3.6

  18. Is there a statistically significant difference in weight loss programs? • Yes • No • ??

  19. Example 1. H0: m1=m2=m3=m4 H1: Means are not all equal a=0.05 2. Test statistic

  20. Example 3. Decision rule df1=k-1=4-1=3 df2=N-k=20-4=16 Reject H0 if F > 3.24

  21. Example =5(6.6-3.6)2+5(3.0-3.6)2+5(3.4-3.6)2+5(1.2-3.6)2 = 75.8

  22. Example

  23. Example

  24. Example

  25. Example

  26. Example =21.4 + 10.0 + 5.4 + 10.6 = 47.4

  27. Example Source of Sums of Mean Variation Squares df Squares F Between 75.8 3 25.3 8.43 Treatments Error 47.4 16 3.0 Total 123.2 19

  28. Example 4. Compute test statistic F=8.43 5. Conclusion. Reject H0 because 8.43 > 3.24. We have statistically significant evidence at a=0.05 to show that there is a difference in mean weight loss among 4 different diet programs.

  29. ANOVA Using R .csv data file

  30. Example An investigator wishes to compare the average time to relief of headache pain under three distinct medications, A, B and C. Fifteen patients who suffer from chronic headaches are randomly selected for the investigation. The outcome is time to pain relief, in minutes.

  31. One Way ANOVA RCT to Compare 3 Medications for Chronic Pain N=15 Randomize A B C Outcome: Time to Pain Relief, minutes

  32. One Way ANOVA (cont’d) Data Drug A Drug B Drug C 30 25 15 35 20 20 40 30 25 25 20 20 35 30 20 Mean 33.0 25.0 20.0

  33. One Way ANOVA (cont’d) • Hypotheses H0: m1 = m2 = m3 H1: means not all equal a=0.05 2. Test Statistic F

  34. One Way ANOVA (cont’d) 3. Decision Rule K-1=3-1=2, N-k=15-3=12 Reject H0 if F > 3.89 4. Compute Sums of Squares

  35. One Way ANOVA (cont’d) = 5((33-26.0)2 + (25-26.0)2 + (20-26.0)2) = 430

  36. One Way ANOVA (cont’d) Drug A X (X-33) (X-33)2 30 -3 9 35 -2 4 40 7 49 25 -8 64 35 -2 4 0 130

  37. One Way ANOVA (cont’d) Drug B X (X-25) (X-25)2 25 0 1 20 -5 25 30 5 25 20 -5 25 30 5 25 0 100

  38. One Way ANOVA (cont’d) Drug C X (X-20) (X-20)2 15 -5 25 20 0 0 25 5 25 20 0 0 20 0 0 0 50

  39. One Way ANOVA (cont’d) = 130+100+50 = 280 Source SS df MS F Between 430.0 2 215 9.21 Error 280.0 12 23.3 Total 710.0 14

  40. One Way ANOVA (cont’d) Reject H0 since 9.21 > 3.89 – Means are not all equal.

  41. Paper – Testosterone Replacement • Study design? • RCT • Number of comparison groups? -placebo, no exercise -testosterone, no exercise -placebo and exercise -testosterone and exercise • Primary outcomes? • Change in muscle strength, body weight, muscle volume, lean body mass (continuous)

  42. Paper – Testosterone Replacement • Objective is to compare mean change in muscle strength, body weight, muscle volume, lean body mass (One at a time) across four treatment groups • Figure 1 – generalizability?

  43. Paper – Testosterone Replacement • Table 1 – what tests were used? • Table 2 – what tests were used?

  44. Practice Problem – Complete the ANOVA Table H0: m1=m2=m3=m4=m5 H1: means not all equal a=0.05 Source SS df MS F Between Within 50 2.5 Total 225

  45. Practice Problem – Complete the ANOVA Table H0: m1=m2=m3=m4=m5 H1: means not all equal a=0.05 Source SS df MS F Between 100 4 25 10 Within 125 50 2.5 Total 225 Reject H0 if F > F0.05(4,50)=2.56

  46. ANOVA • When the sample sizes are equal, the design is said to be balanced • Balanced designs give greatest power and are more robust to violations of the normality assumption

More Related