Docsity

Factor Effects Model - Lecture Slides | BIOS 662, Study notes of Data Analysis & Statistical Methods

Partial preview of the text

Download Factor Effects Model - Lecture Slides | BIOS 662 and more Study notes Data Analysis & Statistical Methods in PDF only on Docsity!

Analysis of Variance III Bios 662

Michael G. Hudgens, Ph.D. [email protected] http://www.bios.unc.edu/∼mhudgens 2006-11-08 17:

Outline

  • Equivalency: ANOVA and Regression
  • Inference Overview
  • Diagnostics
  • Nonparameteric Alternative: Kruskal-Wallis

Linear Regression Formulation

  • Define X 1 i such that

X 1 i =

1 if ith obs in group 1 −1 if ith obs in group K 0 ow

  • Moreover, for l = 1,... , K − 1, define Xli such that

Xli =

1 if ith obs in group l −1 if ith obs in group K 0 ow

Equivalency

  • Factor effects model

Yij = μ + αi + ij

  • The linear regression model

Yi = α + β 1 X 1 i + β 2 X 2 i + · · · + βK− 1 XK− 1 ,i + i

  • Equivalent:

α = μ; α 1 = β 1 ; α 2 = β 2 ; · · · ; αK− 1 = βK− 1

αK = −

K∑− 1

l=

βl

ANOVA: Inference and Testing

  • Linear combination

L =

∑^ K

i=

ciμi

  • Contrast if

i ci^ = 0

  • Estimator

Lˆ =

∑^ K

i=

ci Y¯i·

  • Compute CIs and test statistics using

Lˆ − L √ M SE

i c^2 i /ni

∼ tN −K

ANOVA: Multiplicity Adjustments

  • Factor level means, i.e, μ 1 , μ 2 ,.. .: Bonferroni

In SAS, Proc GLM/ANOVA: means group/bon clm;

  • Pairwise comparisons: Tukey
  • Contrasts: Scheffe or Bonferroni

eg, multiplicity adjusted CIs for a family of contrasts of the form Lˆ ±

M SE

i

c^2 i /ni ×

(K − 1)FK− 1 ,N −K;1−α

  • Linear combinations: Bonferroni

ANOVA: Diagnostics

  • Homogeneity of variance
    • Inspect plot of raw data or standard deviation by group means
    • Hartley’s and Cochran’s test

FM AX = s

(^2) max s^2 min

, C = s

(^2) max ∑ s^2 i tables given in Web appendix of text

  • These tests require equal sample size and sensitive to normality assumption

ANOVA: Diagnostics

  • Homogeneity of variance
    • Modified Levene test: apply ANOVA to abs dev from group medians dij = |Yij − Y˜i·| use usual F test; rejection indicates lack of homogene- ity
    • Robust to normality, does not require equal sample sizes
    • Cf Chapter 18.2 of Neter et al. Applied Linear Sta- tistical Models, 4th Edition, 1996.

Modified Levene Test: SAS

proc anova; class group; model age=group; means group/hovtest=bf;

The ANOVA Procedure Brown and Forsythe’s Test for Homogeneity of age Variance ANOVA of Absolute Deviations from Group Medians Sum of Mean Source DF Squares Square F Value Pr > F group 3 0.8003 0.2668 0.19 0. Error 19 26.3125 1. Level of -------------age------------- group N Mean Std Dev active 6 10.1250000 1. eight 5 12.3500000 0. no 6 11.7083333 1. passive 6 11.3750000 1.

Modified Levene Test: R

Levene <- function(y, group) { group <- as.factor(group) # precautionary meds <- tapply(y, group, median) resp <- abs(y - meds[group]) anova(lm(resp ~ group))[1, 4:5] }

Levene(age,group) F value Pr(>F) group 0.1926 0.

ANOVA: Diagnostics for Normality

  • Critical values for α = 0. 05

N CV N CV N CV 5 0.88 10 0.92 24 0. 6 0.89 12 0.93 30 0. 7 0.90 15 0.94 40 0. 8 0.91 20 0.95 50 0. 9 0.91 22 0.95 100 0.

ANOVA: Diagnostics for Normality

l

l l

l

l

l l l l

l

l

l

l

l

l

l

l l l

l

l

l

l

−2 −1 0 1 2

−^

−^

0

1

2

3

Normal Q−Q Plot

Theoretical Quantiles

Sample Quantiles

ANOVA: Diagnostics

  • Remedial measures
    1. Normality: appeal to CLT
    2. Transformations
      • Plot (¯yi·, si), (¯yi·, s^2 i ), (¯y i^2 ·, si); linearity suggests log(y), √y, 1/y transformations
      • Box-Cox family: minimize SSE (ie within group SS)
    3. Nonparametrics, eg, Kruskal-Wallis

Box-Cox Transformations

So that the magnitude of the error sum of squares does not depend on p, use:

Yp =

k 1 (Y p^ − 1) for p 6 = 0 k 2 log(Y ) for p = 0

where

k 2 =

i,j

Yij

1 /N and k 1 = 1 pk 2 p−^1