Extensions of One-Way ANOVA.

Similar documents
Extensions of One-Way ANOVA.

COMPARING SEVERAL MEANS: ANOVA

Comparing Several Means: ANOVA

Difference in two or more average scores in different groups

Biostatistics for physicists fall Correlation Linear regression Analysis of variance

Workshop 7.4a: Single factor ANOVA

8/23/2018. One-Way ANOVA F-test. 1. Situation/hypotheses. 2. Test statistic. 3.Distribution. 4. Assumptions

One-way between-subjects ANOVA. Comparing three or more independent means

BIOL Biometry LAB 6 - SINGLE FACTOR ANOVA and MULTIPLE COMPARISON PROCEDURES

Regression and the 2-Sample t

One-way between-subjects ANOVA. Comparing three or more independent means

Analysis of Covariance (ANCOVA)

Simple, Marginal, and Interaction Effects in General Linear Models

Repeated-Measures ANOVA in SPSS Correct data formatting for a repeated-measures ANOVA in SPSS involves having a single line of data for each

MS&E 226: Small Data

Multiple Regression. More Hypothesis Testing. More Hypothesis Testing The big question: What we really want to know: What we actually know: We know:

Nature vs. nurture? Lecture 18 - Regression: Inference, Outliers, and Intervals. Regression Output. Conditions for inference.

In a one-way ANOVA, the total sums of squares among observations is partitioned into two components: Sums of squares represent:

Variance Decomposition and Goodness of Fit

Lecture 4 Multiple linear regression

Linear Modelling in Stata Session 6: Further Topics in Linear Modelling

One-Way ANOVA Cohen Chapter 12 EDUC/PSY 6600

ANOVA. Testing more than 2 conditions

R 2 and F -Tests and ANOVA

Inference for Regression

Linear Regression. In this lecture we will study a particular type of regression model: the linear regression model

Nested 2-Way ANOVA as Linear Models - Unbalanced Example

Unbalanced Data in Factorials Types I, II, III SS Part 1

Last updated: Oct 18, 2012 LINEAR REGRESSION PSYC 3031 INTERMEDIATE STATISTICS LABORATORY. J. Elder

MODELS WITHOUT AN INTERCEPT

Example: Poisondata. 22s:152 Applied Linear Regression. Chapter 8: ANOVA

One-Way ANOVA. Some examples of when ANOVA would be appropriate include:

ST430 Exam 2 Solutions

Lecture 6 Multiple Linear Regression, cont.

Formula for the t-test

22s:152 Applied Linear Regression. Take random samples from each of m populations.

ANOVA, ANCOVA and MANOVA as sem

ANOVA Analysis of Variance

Introduction to Analysis of Variance. Chapter 11

Acknowledgements. Outline. Marie Diener-West. ICTR Leadership / Team INTRODUCTION TO CLINICAL RESEARCH. Introduction to Linear Regression

Regression and Models with Multiple Factors. Ch. 17, 18

Analysis of Variance (ANOVA)

22s:152 Applied Linear Regression. There are a couple commonly used models for a one-way ANOVA with m groups. Chapter 8: ANOVA

Lecture 18: Simple Linear Regression

Review. One-way ANOVA, I. What s coming up. Multiple comparisons

Example. Multiple Regression. Review of ANOVA & Simple Regression /749 Experimental Design for Behavioral and Social Sciences

Week 7 Multiple factors. Ch , Some miscellaneous parts

Two-Way ANOVA. Chapter 15

STA441: Spring Multiple Regression. More than one explanatory variable at the same time

ANCOVA. Psy 420 Andrew Ainsworth

Prepared by: Prof. Dr Bahaman Abu Samah Department of Professional Development and Continuing Education Faculty of Educational Studies Universiti

Regression. Marc H. Mehlman University of New Haven

Multiple Linear Regression II. Lecture 8. Overview. Readings

Multiple Linear Regression II. Lecture 8. Overview. Readings. Summary of MLR I. Summary of MLR I. Summary of MLR I

Lecture 10. Factorial experiments (2-way ANOVA etc)

ANOVA continued. Chapter 11

psyc3010 lecture 2 factorial between-ps ANOVA I: omnibus tests

1 The Classic Bivariate Least Squares Model

Biostatistics 380 Multiple Regression 1. Multiple Regression

Stat 401B Final Exam Fall 2015

Stat 412/512 TWO WAY ANOVA. Charlotte Wickham. stat512.cwick.co.nz. Feb

Stat 5102 Final Exam May 14, 2015

Analyses of Variance. Block 2b

Introduction and Single Predictor Regression. Correlation

1.) Fit the full model, i.e., allow for separate regression lines (different slopes and intercepts) for each species

Figure 1: The fitted line using the shipment route-number of ampules data. STAT5044: Regression and ANOVA The Solution of Homework #2 Inyoung Kim

Variance Decomposition in Regression James M. Murray, Ph.D. University of Wisconsin - La Crosse Updated: October 04, 2017

This module focuses on the logic of ANOVA with special attention given to variance components and the relationship between ANOVA and regression.

Multiple Regression: Example

WELCOME! Lecture 13 Thommy Perlinger

A Re-Introduction to General Linear Models (GLM)

General Linear Statistical Models - Part III

Multiple Predictor Variables: ANOVA

MATH 644: Regression Analysis Methods

AMS 7 Correlation and Regression Lecture 8

Motor Trend Car Road Analysis

Exam 3 Practice Questions Psych , Fall 9

Simple Linear Regression

General Linear Statistical Models

STAT 572 Assignment 5 - Answers Due: March 2, 2007

Analysis of Covariance

3. Design Experiments and Variance Analysis

ANCOVA. ANCOVA allows the inclusion of a 3rd source of variation into the F-formula (called the covariate) and changes the F-formula

Preview from Notesale.co.uk Page 3 of 63

Simple, Marginal, and Interaction Effects in General Linear Models: Part 1

10/31/2012. One-Way ANOVA F-test

Inference. ME104: Linear Regression Analysis Kenneth Benoit. August 15, August 15, 2012 Lecture 3 Multiple linear regression 1 1 / 58

R Demonstration ANCOVA

Simple linear regression

Swarthmore Honors Exam 2012: Statistics

Multiple Linear Regression. Chapter 12

Lecture 2. The Simple Linear Regression Model: Matrix Approach

22s:152 Applied Linear Regression. Chapter 8: 1-Way Analysis of Variance (ANOVA) 2-Way Analysis of Variance (ANOVA)

The independent-means t-test:

Multiple Linear Regression II. Lecture 8. Overview. Readings

Multiple Linear Regression II. Lecture 8. Overview. Readings. Summary of MLR I. Summary of MLR I. Summary of MLR I

" M A #M B. Standard deviation of the population (Greek lowercase letter sigma) σ 2

Recall that a measure of fit is the sum of squared residuals: where. The F-test statistic may be written as:

ST430 Exam 1 with Answers

Stat 411/511 ESTIMATING THE SLOPE AND INTERCEPT. Charlotte Wickham. stat511.cwick.co.nz. Nov

Transcription:

Extensions of One-Way ANOVA http://www.pelagicos.net/classes_biometry_fa17.htm

What do I want You to Know What are two main limitations of ANOVA? What two approaches can follow a significant ANOVA? How do they differ? What is the theory behind ANCOVA? Appreciate that ANCOVA is a hybrid between ANOVA and linear regression However, you will not need to do these tests in a quiz, either using R or by hand

Limitations of One-Way ANOVA Sometimes, we want to determine differences amongst treatments. We have two options: o Post Hoc Tests Not Planned (no hypothesis), All pairs of means o Contrasts / Comparisons Planned a priori, Hypothesis driven, Subset Sometimes, there are other co-varying factors that cannot be controlled. We have one option: ANCOVA ANOVA with covariates Hybrid between ANOVA and linear regression

Doing an ANOVA Output > AnovaModel.1 <- aov(libido ~ dose, data=viagra) > summary(anovamodel.1) Df SumSq MeanSq Fvalue Pr(>F) dose 2 20.13 10.067 5.119 0.0247 * Residuals 12 23.60 1.967 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > with(dataset, numsummary(libido, groups=dose, statistics=c("mean", "sd"))) mean sd data:n high 5.0 1.581139 5 low 2.2 1.303840 5 mid 3.2 1.303840 5

ANOVA as Regression outcome model error i i libido b b high b low i 0 2 i 1 i i

ANOVA as Regression Placebo Group libido b b high b low libido b b 0 b 0 libido X i 0 2 i 1 i i i i b b 0 2 1 0 placebo 0

ANOVA as Regression Low Dose Group libido b b high b low i 0 2 i 1 i i libido b b 0 b 1 libido i i b 0 2 1 b 0 1 libido b b i 0 1 X X b Low placebo 1 b X X 1 low placebo

ANOVA as Regression High Dose Group libido b b high b low i 0 2 i 1 i i libido b b 1 b 0 i 0 2 1 libido i b b 0 2 libido b b i 0 2 X X b high placebo 2 b X X 2 high placebo

ANOVA as Regression We include two dummy variables, whose numerical values are codes for the different treatments: Dummy1: low drug dose Dummy2: high drug dose

ANOVA as Regression AnovaModel.2<- lm(libido~dummy1+dummy2, data=viagradummy) Rcmdr> summary(regmodel.6) Call: lm(formula = libido ~ dummy1 + dummy2, data = libidodummy) Coefficients: Estimate Std. Error t value Pr(> t ) (Intercept) 2.2000 0.6272 3.508 0.00432 ** dummy1 1.0000 0.8869 1.127 0.28158 dummy2 2.8000 0.8869 3.157 0.00827 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' 1 Residual standard error: 1.402 on 12 degrees of freedom Multiple R-squared: 0.4604, Adjusted R-squared: 0.3704 F-statistic: 5.119 on 2 and 12 DF, p-value: 0.02469

1) ANOVA with Planned Comparisons Theoretical Approach: The variability explained by the Model (the experimental manipulation, SS M ) is due to participants being assigned to different groups. This variability can be broken down to test specific hypotheses about which groups differ. We break down the variance according to hypotheses made a priori (before the experiment). It s like cutting up a cake (yum!)

ANOVA with Planned Comparisons Rules When Selecting Contrasts: Independent contrasts must not interfere with each other (they must test unique hypotheses). Only 2 Chunks of Cake K-1 Each contrast should compare only 2 chunks of variation (why?). You should always end up with one less contrast than the number of groups.

ANOVA with Planned Comparisons Selecting Hypotheses: Example: Testing the effects of a Drug on Goal scoring using 3 groups: Placebo (Sugar Pill) Low Dose Drug High Dose Drug Dependent Variable (DV) was the mean number of goals scored per game. What might we expect to happen?

ANOVA with Planned Comparisons Hint: In most experiments we usually have one or more control groups. The logic of control groups dictates that we expect them to be different from groups that we have manipulated. The first contrast will always be to compare any control groups (chunk 1) with any experimental conditions (chunk 2).

ANOVA with Planned Comparisons Hypotheses: Hypothesis 1: People who take the drug will score more goals than those who don t take the drug. Placebo (Low, High) Hypothesis 2: People taking a high dose of the drug will score more goals than those taking a low dose. Low High

ANOVA with Planned Comparisons Hypotheses: Partitioning the variance

Planned Comparisons Rules Rule 1: Groups coded with positive weights compared to groups coded with negative weights. Rule 2: If a group is not involved in a comparison, assign it a weight of zero. Rule 3: For a given contrast, weights assigned to group(s) in one chunk of variation should be equal to the number of groups in opposite chunk of variation. Rule 4: Sum of weights for a comparison should be zero. Rule 5: If a group singled out in a comparison, that group should not be used in any subsequent contrasts.

Planned Comparisons Rules Chunk 1 Low Dose + High Dose Chunk 2 Placebo Contrast 1 Positive Negative Sign of Weight 1 2 Weights +1 +1-2 Sign

Planned Comparisons Rules Chunk 1 Low Dose Chunk 2 High Dose Contrast 2 Placebo Not in Contrast Positive Negative Sign of Weight 1 1 Weights 0 +1-1 Sign 0

ANOVA with Planned Comparisons Use goals.xlsx dataset Planned Comparisons: Placebo vs Any Drug Low and High Dose Level Contrast placebo low high 1-2 1 1 2 0-1 1

ANOVA with Planned Comparisons Use command contrasts to set up planned comparisons > contrasts(goalsdata$goals)<-cbind(c(-2,1,1), c(0,-1,1)) > goalmodel<-aov(goals ~ dose, data = goalsdata) > anova(goalmodel) Analysis of Variance Table Response: goals Df Sum Sq Mean Sq F value Pr(>F) dose 2 20.133 10.0667 5.1186 0.02469 * Residuals 12 23.600 1.9667 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

ANOVA with Planned Comparisons > summary.lm(goalmodel) Call: aov(formula = goals ~ dose, data = goalsdata) Coefficients: Estimate Std. Error t value Pr(> t ) (Intercept) 5.0000 0.6272 7.972 0.0000039 *** dose[t.low] -1.8000 0.8869-2.029 0.06519. dose[t.placebo] -2.8000 0.8869-3.157 0.00827 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' 1 Residual standard error: 1.402 on 12 degrees of freedom Multiple R-squared: 0.4604, Adjusted R-squared: 0.3704 F-statistic: 5.119 on 2 and 12 DF, p-value: 0.02469

ANOVA with Planned Comparisons Placebo and 2 dose levels Planned Comparisons Results SIG N.S. Placebo VS Any Drug Low Dose VS High Dose

Planned ANOVA Summary One-way ANOVA allow us to analyze more complex experiments involving only one independent variable (factor) manipulated in multiple ways and only one measured outcome variable. Planned comparisons allow researchers to test specific hypotheses about treatment effects. This approach apportions the model variance into its components the differences between groups.

2) ANOVA with Covariates ANCOVA When and Why do we use ANCOVA? To test for differences between group means when we another variable affects the outcome variable. Used to control known extraneous variables. Advantages of ANCOVA Reduces Error Variance By explaining some of unexplained variance (SS R ) the error variance in the model can be reduced. Greater Experimental Control By controlling extraneous variables, we gain greater insight into effect of predictor variable.

Theory of ANCOVA Goal: Partition the Residual Variance Further SS T Total Variance In The Data SS M Improvement Due to the Model SS R Error in Model Covariate SS R NOTE: ANCOVA can include multiple covariates

ANCOVA Uses Multiple Regression The covariate can be added to the regression model of the ANOVA. To evaluate the effect of the experimental manipulation, controlling for the covariate, we enter the covariate into the model first (think back to hierarchical regression). Y i b b X b 0 1 i 2 Covariate Goals i b 0 b1 Dosei b Participants 2 Fitness i

ANCOVA An Example Revisit Libido Drug example (ANOVA lecture). There are several possible confounding variables (e.g. how fit you are) Conduct same study but quantify libido of each subject s partner while you are doing the experiment. Outcome (or DV) = Participant s Libido Predictor (or IV) = Dose of Drug (Placebo, Low & High) Covariate = Participant Partner s Libido

ANCOVA The Data data: libido and partnerlibido t = 1.345, df = 28, p-value = 0.1894 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: -0.1250150 0.5571688 sample estimates: cor 0.2463496

ANCOVA The Approach First, remove the influence of the covariate on the dependent variable using linear regression Residuals Then, compare the regression residuals across drug dose groups NOTE: this approach requires a type III Test

The 3 Sum of Square Calculations Usually the hypothesis is about the significance of one factor while controlling for the level of the other factors. This equates to using type II or III SS. In general, if there is no significant interaction effect, then type II is more powerful. If interaction is present, then type II is inappropriate while type III can be used. How Does Type III Sum of Squares Works: SS(A B, AB) for factor A. SS(B A, AB) for factor B. This type tests for the presence of a main effect after the other interaction. This approach is therefore valid in the presence of significant interactions.

ANCOVA In R (type II test) > contrasts(viagradata$dose)<-cbind(c(-2,1,1), c(0,-1,1)) > viagramodel<-aov(libido ~ partnerlibido + dose, data = viagradata) > Anova(viagraModel) Anova Table (Type II tests) Response: libido Sum Sq Df F value Pr(>F) partnerlibido 15.076 1 4.9587 0.03483 * dose 25.185 2 4.1419 0.02745 * Residuals 79.047 26 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

ANCOVA In R (type III test) > contrasts(viagradata$dose)<-cbind(c(-2,1,1), c(0,-1,1)) > viagramodel<-aov(libido ~ partnerlibido + dose, data = viagradata) > Anova(viagraModel, type="iii") Anova Table (Type III tests) Response: libido Sum Sq Df F value Pr(>F) (Intercept) 76.069 1 25.0205 0.00003342 *** partnerlibido 15.076 1 4.9587 0.03483 * dose 25.185 2 4.1419 0.02745 * Residuals 79.047 26 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Assumptions of ANCOVA ANCOVA is a parametric test based on normal distributions. Therefore, it has all of the same assumptions as ANOVA. Because ANCOVA relies on linear regression, it has all of the same assumptions. We can save and test the regression residuals like we did for linear regression models. Suggest comparing results with both the type II and type III Sum of Squares

ANCOVA Summary ANOVA cannot control exogenous (external) variables varying independently from treatments. ANCOVA uses general linear regression to introduce one or more linear regression terms. Covariates allow researchers to test specific hypotheses about exogenous (external) effects. Approach re-apportions some of the unexplained (error) variance into the model variance.