+ Comparing several means: ANOVA (GLM 1) Chapter 10.

Slides:



Advertisements
Similar presentations
Comparing several means: ANOVA (GLM 1)
Advertisements

Analysis of variance (ANOVA)-the General Linear Model (GLM)
Model Adequacy Checking in the ANOVA Text reference, Section 3-4, pg
ANOVA: Analysis of Variance
Analysis of Variance (ANOVA) Statistics for the Social Sciences Psychology 340 Spring 2010.
One-Way Between Subjects ANOVA. Overview Purpose How is the Variance Analyzed? Assumptions Effect Size.
More on ANOVA. Overview ANOVA as Regression Comparison Methods.
Lecture 10 PY 427 Statistics 1 Fall 2006 Kin Ching Kong, Ph.D
ANOVA Analysis of Variance: Why do these Sample Means differ as much as they do (Variance)? Standard Error of the Mean (“variance” of means) depends upon.
Analysis of Variance: Inferences about 2 or More Means
Comparing Means.
Intro to Statistics for the Behavioral Sciences PSYC 1900
Lecture 9: One Way ANOVA Between Subjects
Two Groups Too Many? Try Analysis of Variance (ANOVA)
Statistics for the Social Sciences Psychology 340 Spring 2005 Analysis of Variance (ANOVA)
One-way Between Groups Analysis of Variance
K-group ANOVA & Pairwise Comparisons ANOVA for multiple condition designs Pairwise comparisons and RH Testing Alpha inflation & Correction LSD & HSD procedures.
Comparing Means.
Today Concepts underlying inferential statistics
Lorelei Howard and Nick Wright MfD 2008
Administrata New final exam schedule: Handed out Tues, Dec 3
Analysis of Variance. ANOVA Probably the most popular analysis in psychology Why? Ease of implementation Allows for analysis of several groups at once.
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.
ANCOVA Lecture 9 Andrew Ainsworth. What is ANCOVA?
Department of Cognitive Science
ANOVA Analysis of Variance.  Basics of parametric statistics  ANOVA – Analysis of Variance  T-Test and ANOVA in SPSS  Lunch  T-test in SPSS  ANOVA.
ANOVA Greg C Elvers.
Comparing Means. Anova F-test can be used to determine whether the expected responses at the t levels of an experimental factor differ from each other.
COURSE: JUST 3900 INTRODUCTORY STATISTICS FOR CRIMINAL JUSTICE Instructor: Dr. John J. Kerbs, Associate Professor Joint Ph.D. in Social Work and Sociology.
Stats Lunch: Day 7 One-Way ANOVA. Basic Steps of Calculating an ANOVA M = 3 M = 6 M = 10 Remember, there are 2 ways to estimate pop. variance in ANOVA:
Chapter 11 HYPOTHESIS TESTING USING THE ONE-WAY ANALYSIS OF VARIANCE.
Chapter 13 Analysis of Variance (ANOVA) PSY Spring 2003.
One-way Analysis of Variance 1-Factor ANOVA. Previously… We learned how to determine the probability that one sample belongs to a certain population.
Between-Groups ANOVA Chapter 12. >When to use an F distribution Working with more than two samples >ANOVA Used with two or more nominal independent variables.
 Slide 1 Two-Way Independent ANOVA (GLM 3) Chapter 13.
Chapter 10: Analyzing Experimental Data Inferential statistics are used to determine whether the independent variable had an effect on the dependent variance.
Statistics for the Social Sciences Psychology 340 Fall 2013 Tuesday, October 15, 2013 Analysis of Variance (ANOVA)
6/2/2016Slide 1 To extend the comparison of population means beyond the two groups tested by the independent samples t-test, we use a one-way analysis.
Educational Research Chapter 13 Inferential Statistics Gay, Mills, and Airasian 10 th Edition.
Chapter 13 - ANOVA. ANOVA Be able to explain in general terms and using an example what a one-way ANOVA is (370). Know the purpose of the one-way ANOVA.
Chapter 14 Repeated Measures and Two Factor Analysis of Variance
Analysis of Variance (One Factor). ANOVA Analysis of Variance Tests whether differences exist among population means categorized by only one factor or.
+ Comparing several means: ANOVA (GLM 1) Chapter 11.
Repeated-measures designs (GLM 4) Chapter 13. Terms Between subjects = independent – Each subject gets only one level of the variable. Repeated measures.
Marshall University School of Medicine Department of Biochemistry and Microbiology BMS 617 Lecture 13: One-way ANOVA Marshall University Genomics Core.
Statistics for Psychology CHAPTER SIXTH EDITION Statistics for Psychology, Sixth Edition Arthur Aron | Elliot J. Coups | Elaine N. Aron Copyright © 2013.
Mixed ANOVA (GLM 5) Chapter 14. Mixed ANOVA Mixed: – 1 or more Independent variable uses the same participants (repeated measures) – 1 or more Independent.
Chapter 12 Introduction to Analysis of Variance PowerPoint Lecture Slides Essentials of Statistics for the Behavioral Sciences Eighth Edition by Frederick.
Chapter 13 Repeated-Measures and Two-Factor Analysis of Variance
Chapter 13 For Explaining Psychological Statistics, 4th ed. by B. Cohen 1 Chapter 13: Multiple Comparisons Experimentwise Alpha (α EW ) –The probability.
ANOVA P OST ANOVA TEST 541 PHL By… Asma Al-Oneazi Supervised by… Dr. Amal Fatani King Saud University Pharmacy College Pharmacology Department.
ONE-WAY BETWEEN-GROUPS ANOVA Psyc 301-SPSS Spring 2014.
Comparing Two Means Chapter 9. Experiments Simple experiments – One IV that’s categorical (two levels!) – One DV that’s interval/ratio/continuous – For.
Statistics for the Social Sciences Psychology 340 Spring 2009 Analysis of Variance (ANOVA)
Linear Regression Chapter 7. Slide 2 What is Regression? A way of predicting the value of one variable from another. – It is a hypothetical model of the.
Introduction to ANOVA Research Designs for ANOVAs Type I Error and Multiple Hypothesis Tests The Logic of ANOVA ANOVA vocabulary, notation, and formulas.
Simple ANOVA Comparing the Means of Three or More Groups Chapter 9.
Outline of Today’s Discussion 1.Independent Samples ANOVA: A Conceptual Introduction 2.Introduction To Basic Ratios 3.Basic Ratios In Excel 4.Cumulative.
Independent Samples ANOVA. Outline of Today’s Discussion 1.Independent Samples ANOVA: A Conceptual Introduction 2.The Equal Variance Assumption 3.Cumulative.
Simple Statistical Designs One Dependent Variable.
Between-Groups ANOVA Chapter 12. Quick Test Reminder >One person = Z score >One sample with population standard deviation = Z test >One sample no population.
Chapter 12 Introduction to Analysis of Variance
Six Easy Steps for an ANOVA 1) State the hypothesis 2) Find the F-critical value 3) Calculate the F-value 4) Decision 5) Create the summary table 6) Put.
Comparing several means: ANOVA (GLM 1)
Analysis of Covariance (ANCOVA)
Psych 706: Stats II Class #2.
Comparing Several Means: ANOVA
Analysis of Variance: repeated measures
Presentation transcript:

+ Comparing several means: ANOVA (GLM 1) Chapter 10

+ When And Why When we want to compare means we can use a t-test. This test has limitations: You can compare only 2 means: often we would like to compare means from 3 or more groups. It can be used only with one Predictor/Independent Variable.

+ When And Why ANOVA Compares several means. Can be used when you have manipulated more than one Independent Variables. It is an extension of regression (the General Linear Model).

+ Why Not Use Lots of t- Tests? If we want to compare several means why don’t we compare pairs of means with t-tests? Can’t look at several independent variables. Inflates the Type I error rate

+ Type 1 error rate Formula = 1 – (1-alpha) c Alpha = type 1 error rate =.05 usually (that’s why the last slide had.95) C = number of comparisons Familywise = across a set of tests for one hypothesis Experimentwise = across the entire experiment

+ Regression v ANOVA ANOVA in Regression: Used to assess whether the regression model is good at predicting an outcome. ANOVA in Experiments: Used to see whether experimental manipulations lead to differences in performance on an outcome (DV). By manipulating a predictor variable can we cause (and therefore predict) a change in behavior? Actually can be the same question! Slide 6

+ What Does ANOVA Tell us? Null Hyothesis: Like a t-test, ANOVA tests the null hypothesis that the means are the same. Experimental Hypothesis: The means differ. ANOVA is an Omnibus test It test for an overall difference between groups. It tells us that the group means are different. It doesn’t tell us exactly which means differ. Slide 7

+ Theory of ANOVA We compare the amount of variability explained by the Model (experiment), to the error in the model (individual differences) This ratio is called the F-ratio. If the model explains a lot more variability than it can’t explain, then the experimental manipulation has had a significant effect on the outcome (DV). Slide 8

+ F-ratio Variance created by our manipulation Removal of brain (systematic variance) Variance created by unknown factors E.g. Differences in ability (unsystematic variance) Drawing here. F-ratio = systematic / unsystematic But now these formulas are more complicated

+ Theory of ANOVA We calculate how much variability there is between scores Total Sum of squares (SS T ). We then calculate how much of this variability can be explained by the model we fit to the data How much variability is due to the experimental manipulation, Model Sum of Squares (SS M )... … and how much cannot be explained How much variability is due to individual differences in performance, Residual Sum of Squares (SS R ). Slide 10

+ Theory of ANOVA If the experiment is successful, then the model will explain more variance than it can’t SS M will be greater than SS R Slide 11

+ ANOVA by Hand Testing the effects of Viagra on Libido using three groups: Placebo (Sugar Pill) Low Dose Viagra High Dose Viagra The Outcome/Dependent Variable (DV) was an objective measure of Libido. Slide 12

+ The Data Slide 13

The data:

+ Step 1: Calculate SS T Slide 15

Slide 16 Grand Mean Total Sum of Squares (SS T ):

Degrees of Freedom (df) Degrees of Freedom (df) are the number of values that are free to vary. In general, the df are one less than the number of values used to calculate the SS. Slide 17

+ Step 2: Calculate SS M Slide 18

Slide 19 Grand Mean Model Sum of Squares (SS M ):

Model Degrees of Freedom How many values did we use to calculate SS M ? We used the 3 means (levels). Slide 20

+ Step 3: Calculate SS R Slide 21

Slide 22 Grand Mean Residual Sum of Squares (SS R ): Df = 4

+ Step 3: Calculate SS R Slide 23

Residual Degrees of Freedom How many values did we use to calculate SS R ? We used the 5 scores for each of the SS for each group. Slide 24

+ Double Check Slide 25

+ Step 4: Calculate the Mean Squared Error Slide 26

+ Step 5: Calculate the F-Ratio Slide 27

Step 6: Construct a Summary Table SourceSSdfMSF Model * Residual Total Slide 28

+ F-tables Now we’ve got two sets of degrees of freedom DF model (treatment) DF residual (error) Model will usually be smaller, so runs across the top of a table Residual will be larger and runs down the side of the table.

+ F-values Since all these formulas are based on variances, F values are never negative. Think about the logic (model / error) If your values are small you are saying model = error = just a bunch of noise because people are different If your values are large then model > error, which means you are finding an effect.

+ Assumptions Data screening: accuracy, missing, outliers Normality Linearity (it is called the general linear model!) Homogeneity – Levene’s (new!) Homoscedasticity (still a form of regression) So you can do the normal screening we’ve already done and add Levene’s test.

+ Assumptions How to calculate Levene’s test: Load the car library! (be sure it’s installed) leveneTest(Y ~ X, data = data, center = mean) Remember that’s the same set up as t.test. We are going to use a mean center since we are using the mean as our model.

+ Assumptions Levene’s Test output What are we looking for?

+ Assumptions ANOVA is often called a “robust test” What? Robustness = ability to still give you accurate results even though the assumptions are bent. Yes mostly: When groups are equal When sample sizes are sufficiently large

+ Run the ANOVA! We are going to use the aov function. Save the output so can you use it for other things we are going to do later. output = aov(Y ~X, data = data) Summary(output)

+ Run the ANOVA!

+ What do you do if homogeneity test was significant? (Levene’s) Run a Welch correction on the ANOVA using the oneway function. oneway.test(Y ~ X, data = data) Note, you don’t save this one – the summary function does not work the same.

+ Run the ANOVA!

+ APA – just F-test part There was a significant effect of Viagra on levels of libido, F(2, 12) = 5.12, p =.03, η 2 =.46. We will talk about Means, SD/SE as part of the post hoc test.

+ Effect size for the ANOVA In ANOVA, there are two effect sizes – one for the overall (omnibus) test and one for the follow up tests (coming next). Let’s talk about the overall test: F-test R 2 η 2 ω 2

+ Effect size for the ANOVA R 2 and ɳ 2 Proportion of variability accounted for by an effect Useful when you have more than two means, gives you the total good variance with 3+ means Small =.01, medium =.06, large =.15 Can only be positive Range from.00 – 1.00

+ Effect size for the ANOVA R 2 – more traditionally listed with regression ɳ 2 – more traditionally listed with ANOVA SSModel/SStotal Remember total = model + residuals Clearly, you have these numbers, but you can also use the summary.lm(output) function to get that number.

+ Effect size for the ANOVA

+ ω 2 R 2 and d tend to overestimate effect size Omega squared is an R 2 style effect size (variance accounted for) that estimates effect size on population parameters SSM – (dfM)*MSR SStotal + MSR

+ Effect size for the ANOVA

+ GPOWER Test Family: F test Statistical Test: ANOVA: Fixed effects, omnibus, one-way Effect size f: hit determine -> effect size from variance -> direct, enter eta squared Alpha =.05 Power =.80 Number of groups = 3

+ Post Hocs and Trends

+ Why Use Follow-Up Tests? The F-ratio tells us only that the experiment was successful i.e. group means were different It does not tell us specifically which group means differ from which. We need additional tests to find out where the group differences lie. Slide 48

+ How? Multiple t-tests We saw earlier that this is a bad idea Orthogonal Contrasts/Comparisons Hypothesis driven Planned a priori Post Hoc Tests Not Planned (no hypothesis) Compare all pairs of means Trend Analysis Slide 49

+ Post Hoc Tests Compare each mean against all others. In general terms they use a stricter criterion to accept an effect as significant. TEST = t.test or F.test CORRECTION = None, Bonferroni, Tukey, SNK, Scheffe Slide 50

+ Post Hoc Tests For all of these post hocs, we are going to use t-test to calculate the if the differences between means is significant. A least significant difference test (aka the t-test) is the same as doing all pairwise t-values We’ve already decided that wasn’t a good idea. Let’s calculate it as a comparison though.

+ Post Hoc Tests We are going to use the agricolae library – install and load it up! All of these functions have the same basic format: Function name Saved aov output “IV” group = FALSE console = TRUE

+ Post Hoc Tests - LSD

+ Post Hoc Tests - Bonferroni Restricted sets of contrasts – these tests are better with smaller families of hypotheses (i.e. less comparisons over they get overly strict). These tests adjust the required p value needed for significance. Bonferroni – through some fancy math, we’ve shown that the family wise error rate is < number of comparisons times alpha. Afw < c(alpha)

+ Post Hoc Tests - Bonferroni Therefore it’s easy to correct for the problem by dividing afw by c to control where alpha = afw / c However, Bonferroni will over correct for large number of tests Other types of restricted contrasts: Sidak-Bonferroni Dunnett’s test

+ Post Hoc Tests - Bonferroni

+ Post Hoc Tests - SNK Pairwise comparisons – basically when you want to run everything compared to everything These tests correct on the smallest mean difference for it to be significant – rather than adjust p values. Student Newman Keuls Considered a walk down procedure: tests differences in order of magnitude However, this test also increases type 1 error rate for those smaller differences in means.

+ Post Hoc Tests - SNK

+ Post Hoc Tests – Tukey HSD Most popular way to correct for Type 1 error problems HSD = honestly significant difference Other types of pairwise comparisons Fisher Hayter Ryan Einot Gabriel Welch (REGW)

+ Post Hoc Tests – Tukey HSD

+ Post Hoc Tests - Scheffe Post – Hoc error correction – these tests are for more exploratory data analyses. These types of tests normally control alpha experiment wise, which makes them more stringent. Controls for all possible combinations (including complex contrasts) – over what we discussed before. These correct the needed cut off value (similar to adjusting p).

+ Post Hoc Tests - Scheffe Scheffe – corrects the cut off score for the F test when doing post hoc comparisons

+ Post Hoc Tests - Scheffe

+ Effect Size Since we are comparing two groups, we want to calculate d or g values for each pairwise comparison. Remember to get the means, sds, and n for each group using tapply(). Also, it’s part of the post hoc output.

+ Reporting Results Continued Post hoc analyses using a Tukey correction revealed that having high dose of Viagra significantly increased libido compared to having a placebo, p =.02, d = 0.58, but having a high dose did not significantly increase libido compared to having a low dose, p =.15, d = The low dose was not significantly different from a placebo, p =.52, d = Include a figure of the means! OR list the means in the paragraph.

+ Fix those factor levels! Use table function to figure out the names of the levels Use the factor function to put them in order Column name = factor(column name, levels = c(“names”, “names”))

+ Trend Analyses Linear trend = no curves Quadratic Trend = a curve across levels Cubic Trend = two changes in direction of trend Quartic Trend = three changes in direction of trend

Trend Analysis

+ Trend Analysis in R First, we have to set up the data: k = 3 ##set to the number of groups contrasts(IV column) = contr.poly(k) ##note this does change the original dataset Then run the exact same ANOVA code we did before: output = aov(libido ~ dose, data = dataset) summary.lm(output)

+ Trend Analysis in R

+ Reporting Results There was a significant linear trend, t(12) = 3.157, p =.008, indicating that as the dose of Viagra increased, libido increased proportionately.