Analysis of Variance

Analysis of Variance

Introduction ANOVA One-Way ANOVA Two-Way ANOVA Further Extensions Useful R-commands Analysis of Variance Janette Walde [email protected] Department of Statistics University of Innsbruck Janette Walde Analysis of Variance Introduction ANOVA One-Way ANOVA Two-Way ANOVA Further Extensions Useful R-commands Outline I 1 Introduction Problems What is Analysis of Variance Some Terminology 2 ANOVA Object of Investigation Exploratory Analysis Notation Assumptions 3 One-Way ANOVA Area of Application Hypothesis Testing Example Janette Walde Analysis of Variance Introduction ANOVA One-Way ANOVA Two-Way ANOVA Further Extensions Useful R-commands Outline II Post-Hoc Analysis Power Analysis 4 Two-Way ANOVA Terminology Assumptions Results Exploratory Analysis Example 5 Further Extensions 6 Useful R-commands Janette Walde Analysis of Variance Introduction ANOVA Problems One-Way ANOVA What is Analysis of Variance Two-Way ANOVA Some Terminology Further Extensions Useful R-commands Problems/Questions Do fertilizer have different effects on different kind of wheat? React females differently on anti-cancer drugs as males? Does water evaporation of soil depend on the kind of vegetation growing, controlling for climate conditions? A new treatment meant to help those with chronic arthritis pain was developed and tested for its long-tern effectiveness. Participants in the experiment rated their level of pain on a 0 (no pain) to 9 (extreme pain) scale at three-month intervals. Was the treatment effective? ( Does the exposure of plants to various amounts of CO2 affect characteristics of the plant? Janette Walde Analysis of Variance Introduction ANOVA Problems One-Way ANOVA What is Analysis of Variance Two-Way ANOVA Some Terminology Further Extensions Useful R-commands What is ANOVA? ANalysis Of VAriance. Partitions the observed variance based on explanatory (independent) variables. Compares partitions to test significance on explanatory variables. Janette Walde Analysis of Variance Introduction ANOVA Problems One-Way ANOVA What is Analysis of Variance Two-Way ANOVA Some Terminology Further Extensions Useful R-commands Some Terminology Between subject design - each subject participates in one and only one group. Within subjects design - the same group of subjects serves in more than one treatment - Subject is now a factor. Mixed design - a study which has both between and within subject factors. Repeated measures - general term for any study in which multiple measurements are measured on the same subject. Can be either multiple treatments or several measurements over time. Janette Walde Analysis of Variance Introduction ANOVA Object of Investigation One-Way ANOVA Exploratory Analysis Two-Way ANOVA Notation Further Extensions Assumptions Useful R-commands Object of investigation Use variances and variance like quantities to study the equality or non-equality of population means. So, although it is analysis of variance we are actually analyzing means, not variances. There are other methods which analyze the variances between groups. Janette Walde Analysis of Variance Introduction ANOVA Object of Investigation One-Way ANOVA Exploratory Analysis Two-Way ANOVA Notation Further Extensions Assumptions Useful R-commands Typical exploratory analysis include Tabulation of the number of subjects in experimental group. Side-by-side box plots. Statistics about each group. Janette Walde Analysis of Variance Introduction ANOVA Object of Investigation One-Way ANOVA Exploratory Analysis Two-Way ANOVA Notation Further Extensions Assumptions Useful R-commands Notation If we have K groups denote the means of the groups as µ1,µ2, ..., µK . Subject i in group j has observation yij : yij = µj + ij 2 where ij are independent distributed N(0, σ ). Can combine this and say that subjects from group j have distribution N(µ, σ2). With random assignment the sample mean for any treatment group is representative of the population mean for that group. Janette Walde Analysis of Variance Introduction ANOVA Object of Investigation One-Way ANOVA Exploratory Analysis Two-Way ANOVA Notation Further Extensions Assumptions Useful R-commands Assumptions 1 The errors ij are normally distributed. 2 Across the conditions the errors have equal spread. Often referred to as equal vaiances Rule of thumb: the assumption is met if the largest variance is less than twice the smallest variance. If unequal variances need to make a correction. This is usually α/2. 3 The errors are independent from each other. Janette Walde Analysis of Variance Introduction ANOVA Object of Investigation One-Way ANOVA Exploratory Analysis Two-Way ANOVA Notation Further Extensions Assumptions Useful R-commands Checking the assumptions Use the residuals which are the estimates of ij . 1 Look at normal probability plot. 2 Look at residual versus fitted plot. 3 Hard to check often assumed from study design. For mild violations of the assumptions there are options for correction. When the assumptions are NOT met the p-values are simply wrong. Janette Walde Analysis of Variance Introduction Area of Application ANOVA Hypothesis Testing One-Way ANOVA Example Two-Way ANOVA Post-Hoc Analysis Further Extensions Power Analysis Useful R-commands Basics One-way ANOVA is used when Only testing the effect of one explanatory variable. Each subject has only one treatment or condition. Thus, a between-subject design. Used to test for differences among two or more independent groups. Gives the same results as two sample t-tests if explanatory variable has to levels. Janette Walde Analysis of Variance Introduction Area of Application ANOVA Hypothesis Testing One-Way ANOVA Example Two-Way ANOVA Post-Hoc Analysis Further Extensions Power Analysis Useful R-commands Hypothesis H0 : µ1 = µ2 = ... = µK H1: The µ’s are not all equal. The null hypothesis is called the overall null and is the hypothesis tested by ANOVA. If the overall null is rejected you must do more specific hypothesis testing to determine which means are different, often referred to as contrasts. Janette Walde Analysis of Variance Introduction Area of Application ANOVA Hypothesis Testing One-Way ANOVA Example Two-Way ANOVA Post-Hoc Analysis Further Extensions Power Analysis Useful R-commands Terminology The sample variance is the sum of the squared deviations from the mean divided by the number of observations minus 1 (x − x¯)2 s2 = i n − 1 P A mean square (MS) is a variance like quantity calculated as the sum of the squared deviations (SS) divided by the degrees of freedom (df ) SS MS = df Janette Walde Analysis of Variance Introduction Area of Application ANOVA Hypothesis Testing One-Way ANOVA Example Two-Way ANOVA Post-Hoc Analysis Further Extensions Power Analysis Useful R-commands Within versus Between In one-way ANOVA we work with two mean square quantities * MSwithin ... the mean square within-groups * MSbetween ... the mean square between-groups For each individual group we have n P i (x −x¯)2 SSi = j=1 ij i dfi ni −1 So the estimate of MSwithin is K SS MS = SSwithin = Pi=1 i within dfwithin N−K And the estimate of MSbetween is K − 2 SSbetween Pi=1 ni (x¯i x¯) MSbetween = = dfbetween K −1 Janette Walde Analysis of Variance Introduction Area of Application ANOVA Hypothesis Testing One-Way ANOVA Example Two-Way ANOVA Post-Hoc Analysis Further Extensions Power Analysis Useful R-commands Mean Squares What do these values mean? 2 MSwithin is considered a true estimate of σ that is unaffected by whether the null or alternative hypothesis is true. 2 MSbetween is considered a good estimate of σ only when the null hypothesis is true. If the alternative is true, values of MSbetween tend to be inflated. Thus, we can look at the ratio of the two mean square values to evaluate the null hypothesis. Janette Walde Analysis of Variance Introduction Area of Application ANOVA Hypothesis Testing One-Way ANOVA Example Two-Way ANOVA Post-Hoc Analysis Further Extensions Power Analysis Useful R-commands Testing the Hypothesis The F-test looks at the variation among the group means relative to the variation within the sample − F = MSbetween = SSbetween/dfbetween = SSbetween/(K 1) MSwithin SSwithin/dfwithin SSwithin/(N−K ) The F-statistic tends to be larger if the alternative hypothesis is true than if the null hypothesis is true. The test statistic F has an F(K − 1, N − K ) distribution. Janette Walde Analysis of Variance Introduction Area of Application ANOVA Hypothesis Testing One-Way ANOVA Example Two-Way ANOVA Post-Hoc Analysis Further Extensions Power Analysis Useful R-commands What does the F ratio tell us? F = MSbetween/MSwithin The denominator is always an estimate of σ2 (under both the null and alternative hypotheses). The numerator is either another estimate of σ2 (under the null) or is inflated (under the alternative). If the null is true, values of F are close to 1. If the alternative is true, values of F are larger. Large values of F depend on the degrees of freedom. Janette Walde Analysis of Variance Introduction Area of Application ANOVA Hypothesis Testing One-Way ANOVA Example Two-Way ANOVA Post-Hoc Analysis Further Extensions Power Analysis Useful R-commands The ANOVA table When running an ANOVA, statistical packages will return an ANOVA table summarizing the SS, MS, df , F-statistic, and p-value: SS df MS F Sig Group (Treatment, SS df MS MSbet. p-value bet. bet. bet. MSwithin between) Residual (Error, SSwithin dfwithin MSwithin within) Total SSbet.+ dfbet.+ SSwithin dfwithin Janette Walde Analysis of Variance Introduction Area of Application ANOVA Hypothesis Testing One-Way ANOVA Example Two-Way ANOVA Post-Hoc Analysis Further Extensions Power Analysis Useful R-commands Example The data are gathered from a plant physiology experiment which investigated the effect of various sugar on the growth of peas. Growth or length is measured in ’ocular units’. Five groups are analyzed, a control group and four groups varying in the kind of sugar and its amount. In each groups there are 10 measurements.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    61 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us