Presentation is loading. Please wait.

Presentation is loading. Please wait.

March 28, 30 Return exam Analyses of covariance 2-way ANOVA Analyses of binary outcomes.

Similar presentations


Presentation on theme: "March 28, 30 Return exam Analyses of covariance 2-way ANOVA Analyses of binary outcomes."— Presentation transcript:

1 March 28, 30 Return exam Analyses of covariance 2-way ANOVA Analyses of binary outcomes

2 Exam 1 Scores N = 23 75% Q3 95 50% Median 83 25% Q1 74 Mean = 83.7 SD = 11.1 90-100A 89-89B 70-79C 30% of Grade 30% Exam 2 30% Assignments 10% Project

3 Analysis of Variance ANOVA simultaneously tests for difference in k means Y - continuous k samples from k normal distributions each size n i, not necessarily equal each with possibly different mean each with constant variance  2

4 Analyses of Covariance Comparing k means adjusting for 1 or more other variables (covariates) Uses –Randomized students to adjust for an imbalance among treatments in a baseline factor. –In observational studies controlling for a confounding factor –To throw light on the nature of treatment effects in a randomized study –Improve precision of estimated differences among treatments

5 Analyses of Covariance Comparing k means adjusting for 1 or more other variables (covariates) Compute adjusted (or least square) means. Sometimes called ANCOVA

6 Original Use Fisher (1941) the Y were yields of tea bushes in an experiment. But the luck of the draw, some treatments will have been allotted to a more productive set of bushes than other treatments Use as an adjustment variable the yields of the bushes in the previous year.

7 Adjusted Means Computation YBAR i = Mean of Y for group I XBAR i = Mean of X for group I XBAR = Mean of X for all groups combined  =Regression slope of X with Y YBAR(A) i = Adjusted mean for group I YBAR(A) i = YBAR i –  XBAR i – XBAR) Adjustment

8 Adjusted Means Computation Observations YBAR(A) i = YBAR i –  XBAR i – XBAR) 1)If  then adjusted mean equals unadjusted mean 2)If mean of X is same for all group then adjusted mean equals unadjusted mean

9 Adjusted Mean Interpretation The mean of Y for the group if the mean of X for the group was at the overall mean. Uses a model to make the mean of X the same for all groups What would the means have been if all groups had the same mean of X?

10 Example from TOMHS Compare 12-month visit mean serum cholesterol between diuretic group and placebo group. 12-mo Avg.Baseline Avg. Diuretic231.7230.7 Placebo219.7224.9 Diff:12.05.8 Note: Diuretic group started out with higher cholesterols so may want to adjust for this difference.

11 Computing the Adjusted Means 12-mo Avg.Baseline Avg. Diuretic231.7230.7 Placebo219.7224.9 Total227.0  =0.894Regression slope of 12-month cholesterol on baseline cholesterol YBAR(A) (Diur)= 231.7 – 0.894 (230.7 – 227.0) = 231.7 – 0.894 (3.7) = 228.4 YBAR(A) (Plac)= 219.7 – 0.894 (224.9 – 227.0) = 219.7 – 0.894 (-3.7) = 221.6 6.8

12 SAS Code PROC GLM; CLASS group; MODEL chol12 = group cholbl/SS3 SOLUTION; MEANS group; LSMEANS group; ESTIMATE ‘Adjusted Mean Dif' group 1 -1; RUN;

13 SAS GLM Output Source DF Type III SS Mean Square F Value Pr > F GROUP 1 3666.8314 3666.8314 6.29 0.0126 cholbl 1 393014.2008 393014.2008 674.26 <.0001 Standard Parameter Estimate Error t Value Pr > |t| Intercept 18.77666226 B 7.90780076 2.37 0.0181 GROUP 3 6.79524641 B 2.70925949 2.51 0.0126 GROUP 6 0.00000000 B... cholbl 0.89351891 0.03441046 25.97 <.0001 Regression slope SOLUTION

14 SAS GLM Output Level of ------------CHOL12----------- ------------cholbl----------- GROUP N Mean Std Dev Mean Std Dev 3 125 231.696000 46.2561633 230.688000 38.9694703 6 221 219.737557 38.5904356 224.909502 37.1702588 Least Squares Means CHOL12 GROUP LSMEAN 3 228.398120 6 221.602873 Standard Parameter Estimate Error t Value Pr > |t| dif 6.79524641 2.70925949 2.51 0.0126 LSMEANS group; ESTIMATE 'dif' group 1 -1; dif

15 Two-Way ANOVA Two categorical factors related to a continuous outcome (Factor A and factor B). If factors are allocated randomly to all combinations of A and B then design called factorial design Questions asked –Overall is A related to Y –Overall is B related to Y –Does the effect of A on Y depend on level of B Example –A = Race; B = BP drug; Y = BP response –A = Vitamin E (y/n); aspirin use (y/n)

16 Factorial Design Example Aspirin + Vitamin E Aspirin + Placebo for Vitamin E Placebo for Aspirin + Vitamin E Placebo for Aspirin + Placebo for Vitamin E A = Aspirin use (yes or no) B = Vitamin E use (yes or no) Placebo for aspirin and placebo for Vitamin E

17 TOMHS Example Question: Do certain BP medications differ in lowering blood pressure in blacks compared to whites? Change in SBP (mm Hg) Diuretic  Blocker Blacks-23.6-8.7 Whites-21.4-17.8 Difference-2.2+9.1 Is the difference –2.2 significantly different from +9.1

18 SAS Code LIBNAME tomhs 'C:\my documents\ph5415\'; DATA temp; SET tomhs.bpstudy; * Choose diuretic and alpha blocker groups; * Variable black = 1 or 2; if group in(3,4); sbpdif = sbp12 - sbpbl; RUN; PROC GLM DATA=temp; CLASS black group; MODEL sbpdif = black group black*group; MEANS black*group; RUN; Tests for interaction

19 SAS OUTPUT The GLM Procedure Level of Level of ------------sbpdif----------- GROUP BLACK N Mean Std Dev 3 1 27 -23.6296296 14.6442379 3 2 97 -21.3505155 14.4939220 4 1 24 -8.7291667 17.5802379 4 2 104 -17.8125000 12.5978091

20 SAS OUTPUT The GLM Procedure Dependent Variable: sbpdif Sum of Source DF Squares Mean Square F Value Pr > F Model 3 3791.89107 1263.96369 6.37 0.0004 Error 248 49197.96210 198.37888 Corrected Total 251 52989.85317 Source DF Type III SS Mean Square F Value Pr > F GROUP 1 3447.055834 3447.055834 17.38 <.0001 BLACK 1 469.412605 469.412605 2.37 0.1253 GROUP*BLACK 1 1309.006907 1309.006907 6.60 0.0108

21 Your Turn Using TOMHS data test


Download ppt "March 28, 30 Return exam Analyses of covariance 2-way ANOVA Analyses of binary outcomes."

Similar presentations


Ads by Google