Analysis of Variance ANOVA.

Slides:



Advertisements
Similar presentations
Multiple-choice question
Advertisements

Independent Sample T-test Formula
Analysis of Variance: ANOVA. Group 1: control group/ no ind. Var. Group 2: low level of the ind. Var. Group 3: high level of the ind var.
Analysis of Variance: Inferences about 2 or More Means
Chapter 3 Analysis of Variance
Lecture 9: One Way ANOVA Between Subjects
Analysis of Variance & Multivariate Analysis of Variance
Intro to Statistics for the Behavioral Sciences PSYC 1900
Chapter 9 - Lecture 2 Computing the analysis of variance for simple experiments (single factor, unrelated groups experiments).
Factorial Designs More than one Independent Variable: Each IV is referred to as a Factor All Levels of Each IV represented in the Other IV.
Lecture 13: Factorial ANOVA 1 Laura McAvinue School of Psychology Trinity College Dublin.
Psy B07 Chapter 1Slide 1 ANALYSIS OF VARIANCE. Psy B07 Chapter 1Slide 2 t-test refresher  In chapter 7 we talked about analyses that could be conducted.
ANOVA Chapter 12.
The basic idea So far, we have been comparing two samples
Inferential Statistics & Test of Significance
64 HR (bpm) Does posture affect HR? Effects of posture lyingsittingstanding.
1 Tests with two+ groups We have examined tests of means for a single group, and for a difference if we have a matched sample (as in husbands and wives)
One-Way Analysis of Variance Comparing means of more than 2 independent samples 1.
Testing Hypotheses about Differences among Several Means.
Chapter 10: Analyzing Experimental Data Inferential statistics are used to determine whether the independent variable had an effect on the dependent variance.
One-Way Analysis of Variance
Previous Lecture: Phylogenetics. Analysis of Variance This Lecture Judy Zhong Ph.D.
1 ANALYSIS OF VARIANCE (ANOVA) Heibatollah Baghi, and Mastee Badii.
Chapter Seventeen. Figure 17.1 Relationship of Hypothesis Testing Related to Differences to the Previous Chapter and the Marketing Research Process Focus.
Hypothesis test flow chart frequency data Measurement scale number of variables 1 basic χ 2 test (19.5) Table I χ 2 test for independence (19.9) Table.
Introduction to ANOVA Research Designs for ANOVAs Type I Error and Multiple Hypothesis Tests The Logic of ANOVA ANOVA vocabulary, notation, and formulas.
Chapter 14: Analysis of Variance One-way ANOVA Lecture 9a Instructor: Naveen Abedin Date: 24 th November 2015.
Two-Way ANOVA Interactions. What we will cover Two-way ANOVA: Family of ANOVA tests More examples in R Looking at interaction plots How to interpret the.
Chapter 11 Analysis of Variance
One-Way Between-Subjects Design and Analysis of Variance
Comparing Multiple Groups:
CHAPTER 26 Comparing Counts.
Copyright © 2008 by Hawkes Learning Systems/Quant Systems, Inc.
SPSS Homework SPSS Homework 12.1 Practice Data from exercise ) Use linear contrasts to compare 5 days vs 20 and 35 days 2) Imagine you.
SEMINAR ON ONE WAY ANOVA
Factorial Experiments
Two way ANOVA with replication
Inferential Statistics
An Introduction to Two-Way ANOVA
i) Two way ANOVA without replication
Comparing Three or More Means
Hypothesis testing using contrasts
Two way ANOVA with replication
Chapter 10: Analysis of Variance: Comparing More Than Two Means
What if. . . You were asked to determine if psychology and sociology majors have significantly different class attendance (i.e., the number of days a person.
PSY 307 – Statistics for the Behavioral Sciences
Comparing Multiple Groups: Analysis of Variance ANOVA (1-way)
Kin 304 Inferential Statistics
What if. . . You were asked to determine if psychology and sociology majors have significantly different class attendance (i.e., the number of days a person.
Introduction to Statistics for the Social Sciences SBS200 - Lecture Section 001, Spring 2018 Room 150 Harvill Building 9:00 - 9:50 Mondays, Wednesdays.
Chapter 11 Analysis of Variance
Analysis of Variance (ANOVA)
Chapter 14: Analysis of Variance One-way ANOVA Lecture 8
Review Compare one sample to another value One sample t-test
Two Categorical Variables: The Chi-Square Test
Example of chai square test (1) false dice
What if. . . You were asked to determine if psychology and sociology majors have significantly different class attendance (i.e., the number of days.
One way ANALYSIS OF VARIANCE (ANOVA)
Psych 231: Research Methods in Psychology
Chapter 13 Group Differences
One-Way ANOVA ANOVA = Analysis of Variance
Statistics for the Social Sciences
Inferential Statistics & Test of Significance
Psych 231: Research Methods in Psychology
Psych 231: Research Methods in Psychology
Marketing Research and Consumer Behavior Insights
Chapter 15 Analysis of Variance
ANOVA: Analysis of Variance
ANalysis Of VAriance Lecture 1 Sections: 12.1 – 12.2
STATISTICS INFORMED DECISIONS USING DATA
Presentation transcript:

Analysis of Variance ANOVA

Partitioning Variance Framework Let’s say I collected a random sample of 100 Women 100 Men --> measured height

TOTAL Variance

Total Variance = Variance due to group differences + Variance due to differences within groups

Total

Among Group Within Group

Ratio of Among to Within t value for the t-test

t = Among / Within = Small / Big = SMALL Among Group Within Group

t = Among / Within = Big / Small = BIG Among Group Within Group

Analysis of Variance: ANOVA Comparing 3 or more means

Hypotheses Ho: A = B HA: A  B

Hypotheses Ho: A = B = C ; all the means are equal HA: A  B = C or A = B  C --> at least one mean is different or A  C = B A  B  C

t-test t-test t-test

Each of the t-tests has a 0 Each of the t-tests has a 0.05 chance (5%) of falsely rejecting the null hypothesis. So what is our TOTAL chance of falsely rejecting the hypothesis that the means are equal? t-test

--> a function of how many comparisons we do using a t-test. # samples being compared 2 3 4 5 10 . # of comparisons 1 6 45 Probability of type I error (=0.05) 0.05 0.14 0.26 0.40 0.9

Variable 1 2 3 Group 3 Sources of variation

Variable 1 2 3 Group 1) Deviation of individual observations from the Grand Mean,

Variable 1 2 3 Group 2) Deviation of individual observations from their Group Mean,

Variable Group2 mean lies right on the grand mean in this instance, not always the case. 1 2 3 Group 3) Deviation of the Group Means from the Grand Mean,

Variable 1 2 3 Group Total Variation (1 above) in the data can be attributed to contributions made by variation of individual observations about their group mean (2 above) and variation of the groups about the grand mean (3 above).

Variable 1 2 3 Group To test whether group means are equal or not, we look at the ratio of variation due to group deviation from the grand mean to the variation of individual observations from their group mean. -> We usually refer to these as among and within group sources of variation

Variable 1 2 3 Group The first step in ANOVA is to calculate all of the pertinent sums of squares Total Among Group Within Group

Variable 1 2 3 Group The second step in ANOVA is to calculate all of the mean squares Total - don’t calculate, is equal to variance for all observations Among Group -> Among Group SS / Among Group DF Within Group -> Within Group SS/ Within Group DF

Variable 1 2 3 Group Degrees of Freedom for ANOVA Total -> total # of observations - 1 n1+n2+n3-1; eg above, 12-1=11 Among Group -> Number of groups -1 = k-1; eg above 3-1=2 Within Group -> Total # of observations - number of groups, N-k eg above 12-3=9

SSTotal = SSAmong + SSWithin Variable 1 2 3 Group Aside SSTotal = SSAmong + SSWithin DFTotal = DFAmong + DFWithin

Variable 1 2 3 Group MSAmong = SSAmong / DFAmong MSWithinr = SSWithin / DFWithin F = MSAmong / MSWithin

Variable 1 2 3 Group MSAmong --> Big MSWithin--> Small F --> BIG Reject Ho

Variable 1 2 3 Group MSAmong --> Small MSWithin--> Big F --> SMALL Do NOT Reject Ho

Yields of corn under 4 fertilizer treatments Control K+N K+P N+P 99 96 63 79 40 84 57 92 61 82 81 91 72 104 59 87 76 99 64 78 84 105 72 71 Mean 72 95 66 83

p

ANOVA - testing for differences among means for various groups --> a couple of ways that we could have come up with our groups 1) we can set them 2) we can determine them randomly

Fixed Effect ANOVA Model I For example, let’s say that there are 26 different medications available to control blood pressure. Perhaps LHSC uses 4 of the: D, G, M, and P --> we want to test the effects of these specific drugs on blood pressure. --> assign patients to each drug randomly and monitor effect on blood pressure --> do ANOVA to test for differences among means Fixed Effect ANOVA Model I

Random Effect ANOVA Model II Alternatively, we may be interested in variability among BP drugs in general --> select 4 at random from all 26 available --> do ANOVA to test for differences among means Random Effect ANOVA Model II

ANOVA, the next level So far --> looked at the effect of a single category on the response in some continuous variable smoking/non-smoking on neonatal birth weight various fertilizers on crop yield etc.

ANOVA also allows us to look at the effects of multiple factors on the response variable of interest For example, in the blood pressure example above, --> we could have added the effects of gender as well 2-Factor ANOVA --> and the effect of race 3-factor ANOVA

2 Factor ANOVA Let’s say, --> look at the influence of drug and gender on BP Questions: What effect does DRUG have? What effect does GENDER have? Does DRUG have the same effect on each GENDER?

Hypotheses: Ho: D = G HA: D  G Ho: male = female HA: male  female Ho: the drugs effect males and females in the same way HA: the drugs effect males and females in different ways Main Effects Interaction

G D D G

G D D G

TOTAL SS DF = N-1

Cells SS kA* kB - 1 = ab - 1

Within Cells (Error) SS DF = ab(n-1)

Factor A SS DF = a - 1

Factor B SS DF = b - 1

Interaction SS = Cells SS - Factor A SS - Factor B SS DF = Cells DF - Factor A DF - Factor B SS

All MS’s are equal to SS divided by appropriate DF EG Factor A MS = Factor A SS / Factor A DF

? Source of Variation df SS MS F Total Cells Factor A Factor B A x B Within Cells ?

Various F calculations - depend on what type of ANOVA. Fixed --> Model I both factors are fixed Random --> Model II both factors are random Mixed model --> Model III one factor fixed and one factor random

Computation of F - statistics for Model I and III ANOVA

Model I - both factors are fixed An Example A researcher is investigating the effect of three drug therapies (labeled 1, 2 and 3) on two different disorders (called depressives and schizophrenics) Model I - both factors are fixed 9 patients with each disorder (18 total) assigned randomly to each drug treatment (3 in each cell) Drug 1 Drug 2 Drug 3 Sch 8 4 0 10 8 6 8 6 4 Dep 14 10 6 4 2 0 15 12 9

Sch Dep Drug 1 Drug 2 Drug 3

Hypotheses: Drug Ho: There is no difference among drugs in Psych score change HA: There is a difference among drugs in Psych score change Disorder Ho: There is no difference among disorders in Psych score change HA: There is a difference among disorders in Psych score change Interaction: Ho: There is no difference in the way the disorders respond to the drugs HA: There is a difference in the way the disorders respond to the drugs

Examine the interaction term first!!! ANOVA Results Effect df MS df MS (F/R) Effect Effect Error Error F p {1}VAR1 Fixed 1 18.00000 12 8.833333 2.037736 .178940 {2}VAR2 Fixed 2 24.00000 12 8.833333 2.716981 .106343 1*2 Fixed 2 72.00000 12 8.833333 8.150943 .005810 Examine the interaction term first!!! 0.00581 < 0.05, therefore reject Ho, there is a significant interaction --> the two disorders respond differently to the two drug treatments If interaction significant, STOP

Hypotheses: Psychiatric Treatment (Factor A) Ho: There is no difference in months to recovery among Psychiatric treatments HA: There is a difference in months to recovery among Psychiatric treatments Physical Therapy Treatment (Factor B) Ho: There is no difference in months to recovery among Physical Therapy treatments HA: There is a difference in months to recovery among Physical Therapy treatments Interaction (AxB) Ho: Physical Therapy treatments respond the same among the Psychiatric treatments HA: Physical Therapy treatments respond differently among the Psychiatric treatments

Reject Interaction Ho ANOVA Results: MONTHS (2way.sta) Effect df MS df MS (F/R) Effect Effect Error Error F p {1}PSYCHTRT 3 30.10941 48 .363539 82.82309 .000000 {2}PYSTHER 5 2.75912 48 .363539 7.58961 .000026 1*2 15 2.13502 48 .363539 5.87288 .000001 Reject Interaction Ho

Hypotheses: Pot Use Ho: There is no difference in maturity among Pot Usage groups HA: There is a difference in maturity among Pot Usage groups Age Ho: There is no difference in maturity among Age groups HA: There is a difference in maturity among Age groups Interaction Ho: The effect of Age on Maturity is the same among the Usage groups HA: The effect of Age on Maturity is NOT the same among the Usage groups

Do NOT reject Interaction Ho (p = 0.2182 > 0.05) ANOVA Results: VAR10 (2way.sta) Effect df MS df MS (F/R) Effect Effect Error Error F p Use Fixed 2 228.7037 18 10.14815 22.53650 .000013 Age Fixed 2 128.7037 18 10.14815 12.68248 .000366 1*2 Fixed 4 16.2037 18 10.14815 1.59672 .218278 Do NOT reject Interaction Ho (p = 0.2182 > 0.05) Reject Use Ho (p = 0.000013 < 0.05) Reject Age Ho (p=0.000366 < 0.05)