450 likes | 674 Views
An alysis O f Va riance. Review Preview ANOVA F test One-way ANOVA Multiple comparison Two-way ANOVA. R eview. Standard normal distribution. Z value: (Observed - Expected ) in terms of UNITS of SD. R eview. For large n,. X. Central Limit Theorem. The beauty of CLT:
E N D
Analysis Of Variance • Review • Preview • ANOVA • F test • One-way ANOVA • Multiple comparison • Two-way ANOVA
Review Standard normal distribution • Z value: • (Observed - Expected) in terms of UNITS of SD
Review For large n, X Central Limit Theorem • The beauty of CLT: • Easy to calculate V • The ugliness of CLT: • Hard to explain p
Review Sampling Distribution of
Review Population & Sampling Distribution • Please add yourself:
STATISTICS Review Flowchart of 2G MD test
ANOVA Analysis of Variance
ANOVA Analysis of Variance • The logic of ANOVA • Partition of sum of squares • F test • One way ANOVA • Multiple comparison • Two way ANOVA • Interaction and confounding
ANOVA B A Eyeball test for 3-sample means 1 2 3 1 2 3 • Using 95% Confidence Limits • A: Non-Significant • B:Significant • Why? • Between group variation • Within group variation • Why not do 2-s test 3 times? • Alpha error inflated • Ex: 7 groups MD comparisons • 1 / 21 < 0.05 !!
ANOVA Data sheet: k groups MD comparison
ANOVA The Logic of one-way ANOVA • Total Difference divided into two parts • (Observed-group mean)+(group mean-grand mean) • • Total sum of squares divided into two parts • SS Total = SS Between + SS Within (or Error) SST = SSB + SSE • • Partition of TD & TSS • Model of one-way ANOVA • B C A
Assumptions in ANOVA • Normal Distribution: Y values in each group • Not very important, esp. for large n • If not ND and small n: Kruskal-Wallis nonparametric • Equal variance: homogeneity • If not: data transformation or ask for help • Random & independent sample
ANOVA F test: variance ratio test • Review: • F test for equal variance in 2-s t test • F test:F=V1/V2 • The larger V is divided by the smaller V • If two variances are about equal, the ratio is about 1 • The critical value of F distribution depends on DFs • ANOVA for mean difference, k groups • Null hypothesis: 1=2 =3=…=k • Variance Between / Variance within • If F is about to 1, it’s meaningless for grouping
ANOVA Sir Ronald Aylmer Fisher 1890-1962 F test : named after Fisher • Characteristics • a sickly, poor-eyesighted child • The teacher used no paper/pencil to teach him • Very strong instinct on geometry • Mathematicians take years to prove his formulas • Persistence • Calculation of ANOVA tables takes Fisher 8 months, 8h/D to finish!! • Reference: • The lady tasting tea, Salsburg, 2001 • 「統計,改變了世界」天下,2001
ANOVA One-way ANOVA
ANOVA One-way ANOVA table • F test:
ANOVA Multiple Comparison • Definition: • Contrast btw 2 means: 12 • More than 2 means is OK: [(1 2 )/2]c • Compare the overall effect of the drug with that of placebo • Contrast Coefficients: add to 0 • Orthogonal • Two contrasts are orthogonal if they don’t use the same information • Ex: (12) and (34), i.e. the questions asked are INDEPENDENT • Types of MC: before or after ANOVA • Priori(planned) comparisons • post hoc(posteriori) comparisons
ANOVA Example 1: one-way ANOVA • Research problem: • Life events, depressive symptoms, and immune function. Irwin M. Am J Psychiatry, 1987; 144:437-441 • Subjects: women whose husbands • treated for lung Ca. • died of lung Ca. in the preceding 1-6 Months • were in good health • X: grouping by scores for major life events • Measurement: Social Readjustment Rating Scale score • Y: immune system function • NK cell activity: lytic units
Printout Box plot & Error bar plot
Printout ANOVA table
Printout Nonparametric ANOVA
ANOVA MC: Priori comparisons • t test for orthogonal comparisons • t statistic: ; not using SDp but MSE • DF: (n1+n2j); n=n1=n2 • Adjusting downward: / (group number) • Ex: 4 comparisons, =0.05/4=0.0125 • Bonferroni t procedure • Applicable for both orthogonal & non-orthogonal • t statistic: • Multiplier table: no. of comparisons & DF for MSE • Able to find CI for mean difference
ANOVA 24.63 22.17 2.46 MOD n=12 HIGH n=12 LOW n=13 MC: Posteriori comparisons • Tukey’s HSD (honestly significant difference) • HSD= • Like Bonferroni, HSD multiplier table is needed (P176, table 7-7) • Able to find CI for mean difference • Ex:
ANOVA MC: Posteriori comparisons • Scheffé’s procedure • S statistic: • j: No. of groups; C: contrast; (alpha, df1, df2)=(0.01, 2, 34) • most versatile (not only pair-wise) & most conservative • EX: Low (Moderate & High) combined; Low Moderate • Note: MD btw L&Hnot significant • Able to find CI for mean difference
ANOVA same as HSD 2 Steps 2 Steps 3 Steps MC: Posteriori comparisons • Newman-Keuls procedure • NK statistic: • Multiplier table is needed • Less conservative than Tukey’s HSD • Unableto find CI for mean difference • Ex:2 steps ; 3 steps
ANOVA MC: Posteriori comparisons • Dunnett’s procedure • Dunnett’s statistic: • Only used in several Tx means with single CTL mean • Relatively low critical value • Ex: • 2 units lower than HSD value; • 4 units lower than Scheffévalue
ANOVA Other posteriori comparisons • Duncan’s new multiple-range test • Same principle as NK test; but with smaller multiplier • Least significant difference, LSD • Use t distribution corresponding to the No. of DF for MSE • levels are inflated. • Proposed by Fisher • The above two procedures are NOT recommended by statisticians for medical research.
ANOVA Summary of Multiple Comparisons • Don’t care about the formulas • Which procedure is better? depends on you! • Pairwise comparisons: • Tukey’s test: the first choice; Newman-Keuls test: second choice • Several Txs with single CTL: • Dunnett’s is the best • Non-pairwise comparisons: • Scheffé is the best • When larger than 0.05 is OK to you: e.x., drug screening • LSD, Duncan’s new multiple-range test are O.K. • The above two are not recommended by the authors
Printout Multiple comparisons
ANOVA Two-way ANOVA
ANOVA The Logic of two-way ANOVA • SST divided into 3 or 4 parts • SST = SSR + SSC + SSE • SST = SSR + SSC + SS(RC) +SSE • Models of two-way ANOVA • Without interaction: • With interaction:
第一天 第二天 ANOVA 第一櫃(大人) 第二櫃(小孩) 兩櫃一起 紅色 黑色 紅色 黑色 紅色 黑色 合適 9 17 3 1 12 18 不合適 1 3 17 9 18 12 Total 10 20 20 10 30 30 90% 85% 15% 10% 40% 60% Simpson’s Paradox: 陳小姐買帽子
ANOVA Statistical Interaction & confounding • Interaction: 2 lines with different slope C0 C1 C1 • Confounding: 2 parallel lines Y C0 • How to test: ANOVA T0 T1
ANOVA Obesity MI Cholesterol Confounding factors • Mixing effect of X2 with X1 & Y • Definition: • Associated With the disease of interest in the absence of exposure • 本身單獨與疾病有相關;本身是危險因子 • Associated With the exposure • 與危險因子有相關 • Not as a result of being exposed. • 干擾不能是中介變項:intervening variable • Intervening variable: X1X2Y • Example: S/S of diseases
ANOVA Interaction & confounding • Interaction: • The effect of X1 varies with the level of X2 • A phenomenon you have to present • Main effects of X1, X2: not meaningfulanymore • Ex:X1(Sex), X2(teaching method) & Y (language score) • Confounding: • Given condition: no interaction • A condition you have to control (or adjust)
ANOVA Two-way ANOVA table
ANOVA Example 2: two-way ANOVA • Research problem: • Glucose tolerance, insulin secretion, insulin sensitivity and glucose effectiveness in normal and overweight hyperthyroid women. Gonzalo MA. Clin Endocrinol, 1996;45:689-697 • X1: BMI; X2: thyroid function • All categorical variables • BMI: 2 level; thyroid function: 2 level; • Y: Insulin sensitivity • Continuous variable
Printout Box plot & Error bar plot, ex 2
Printout Descriptive statistics, ex 2
Printout 2-way ANOVA table, ex 2
Summary Flowchart of 3G MD test 3 or more groups
QUIZ • Q: Can I use ANOVA to test 2G MD? • A: Yes, you can. • Q: What is the relationship btw ANOVA & 2-s t? • A: 2-s t test is a special case of ANOVA • F, t & Z table:
Home Work • Chapter 7, exercise 7, (table 7-20, p187) • Analysis of phenotypic variation in psoriasis as a function of age at onset and family history. Arch. Dermatol. Res. 2002;294:207-213 • Answering the following questions: • Is there a difference in %TBSA (percent of total body surface area affected) related to age at onset? • Is there a difference in %TBSA related to type of psoriasis (familial vs. sporadic)? • Is the interaction significant? • What is your conclusion?