{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ch8_1way_part1_4pp - 1-way ANOVA visual 0.25 0.20 0.15 0.10...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
22s:152 Applied Linear Regression Chapter 8: 1-Way Analysis of Variance (ANOVA) 2-Way Analysis of Variance (ANOVA) ———————————————————— We now consider an analysis with only cate- gorical predictors (i.e. all predictors are factors ). Predicting height from sex (M/F) Predicting white blood cell count from treat- ment group (A,B,C) If only 1 categorical predictor of a continuous response One-Way ANOVA μ 1 μ 2 μ 3 For example, μ dem μ rep μ ind 1 1-way ANOVA visual: 0 5 10 15 20 25 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 Y In a 1-way ANOVA, we’re interested in find- ing di ff erences between population group means, if they exist. ——————————————————— If two categorical predictors of a continuous response Two-Way ANOVA μ 11 μ 12 μ 13 μ 21 μ 22 μ 23 For example, Factor 1 low med high Factor 2 yes no 2 1-way ANOVA (only one factor) Consider the cell means model notation: (It uses 1 parameter to represent each cell mean) Y ij = μ i + ij where μ i is the group i mean. If there’s only 2 levels, like in sex, then we can use a two-sample t -test H 0 : μ 1 = μ 2 . If we have more than 2 levels, we extend this t -test idea to do a 1-way ANOVA. A two-sample t -test is essentially a 1-way ANOVA (it’s the simplest one, there’s only 2 levels to the factor) 3 Suppose we have three populations (or 3 lev- els of a categorical variable) to compare... Example : Does the presence of pets or friends a ff ect the response to stress? n = 45 women (all dog lovers) Each woman randomly assigned to one of three treatment groups as: 1) alone 2) with friend 3) with pet Their heart rate is taken and recorded during a stressful task. Allen, Blascovich, Tomaka, Kelsey, 1988, Journal of Personality and So- cial Psychology. 4
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
> pets=read.csv("pets.csv") > head(pets) group rate 1 P 69.169 2 F 99.692 3 P 70.169 4 C 80.369 5 C 87.446 6 P 75.985 > attach(pets) > is.factor(group) [1] TRUE The treatment groups are: ‘C’ for control group or alone . ‘F’ for with friend . ‘P’ for with pet . Consider the distribution of heart rate by treatment group... 5 > boxplot(rate~group) C F P 60 70 80 90 100 > table(group) group C F P 15 15 15 This is a balanced 1-way ANOVA since all groups have the same number of subjects. 6 Get the mean of each group. > tapply(rate,group,mean) C F P 82.52407 91.32513 73.48307 If we consider μ 1 as the population mean heart rate of the control group, μ 2 as the population mean heart rate of the friends group, μ 3 as the population mean heart rate of the pet group, then, to test if any of the groups have a di ff er- ent heart rate, we would consider the ‘overall’ null hypothesis H 0 : μ 1 = μ 2 = μ 3 H A : at least one μ i is di ff erent for i =1,2,3 7 Why not just do 3 pairwise comparisons?
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}