Stanford STATS 191 - Fixed and Random Effect ANOVA

Unformatted text preview:

Lecture 4: Fixed and Random Effect ANOVANancy R. ZhangStatistics 191, Stanford UniversityJanuary 24, 2007Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 1 / 18ExampleSetting: Personnelmanagement in a largeenterprise.Question: Does theinterviewer have an effect onthe rating of job candidates?Data: 5 interviewers selectedat random, each interviews 4candidates selected atrandom.What is different about this data set?Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 2 / 18Compare to previous casesHow does prior fitness affectrecovery from surgery?Observations: 24 subjects’recovery time.Three fitness levels: belowaverage (8), average (10),above average (6).Here, fitness level is of intrinsic interest. They are not random.Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 3 / 18ExampleSetting: Personnelmanagement in a largeenterprise.Question: Does theinterviewer have an effect onthe rating of job candidates?Data: 5 interviewers selectedat random, each interviews 4candidates selected atrandom.The interviewers are random draws from a larger population.We are interested in the larger population and not these 5 specificinterviewers.Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 4 / 18Another ExampleRecovery time depends onweight gain betweentreatments and duration oftreatment.Two levels of duration, threelevels of weight gain.Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 5 / 18Another ExampleHow does the sodium in beerdiffer between brands?6 randomly chosen brands,8 bottles tested per brand.Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 6 / 18Random Effects ModelAssuming that cell-sizes are the same, i.e. equal observations for each“subject” (brand of beer).Yij∼ µ·+ αi+ εij, 1 ≤ i ≤ r , 1 ≤ j ≤ nεij∼ N(0, σ2)αi∼ N(0, σ2α)Parameters:µ is the population mean;σ2is the measurement variance;σ2αis the population variance of effect (i.e. variation in sodiumcontent of beer).Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 7 / 18Decomposition of Variance and CovarianceVar(Yij) = σ2α+ σ2But only one parameter in mean function:E(Yij) = µ.The observations are no longer independent:Cov(Yij, Yi0j0) =σ2α+ σ2, i = i0, j = j0;σ2α, i = i0, j 6= j0;0, i 6= i0, j 6= j0.Random effects models are also called “variance components”models.Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 8 / 18When cell sizes are the same (balanced),bµ·= Y··=1nrXi,jYij.This also changes estimates of σ2– see ANOVA table below. Wemight guess that df = nr − 1 andbσ2=1nr − 1Xi,j(Yij− Y··)2.This is not the case.Source SS df E(MS)Treatments SSTR =Pri=1n“Yi·− Y··”2r − 1 σ2+ nσ2αError SSE =Pri=1Pnj=1(Yij− Yi·)2(n − 1)r σ2Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 9 / 18One way ANOVA: r groups, n observations in eachgroup.Fixed effect model:Source SS df E(MS)Treatments SSTR =Pri=1n“Yi·− Y··”2r − 1 σ2+ nPri=1α2ir−1Error SSE =Pri=1Pnj=1(Yij− Yi·)2(n − 1)r σ2Random effect model:Source SS df E(MS)Treatments SSTR =Pri=1n“Yi·− Y··”2r − 1 σ2+ nσ2αError SSE =Pri=1Pnj=1(Yij− Yi·)2(n − 1)r σ2Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 10 / 18Inference for population mean: µ·Easy to check thatE(Y··) = µ·Var(Y··) =nσ2α+ σ2rn.To come up with a t statistic that we can use for test, CIs, we needto find an estimate of Var(Y··). ANOVA table saysE(MSTR) = nσ2α+ σ2.Therefore,Y··− µ·qSSTR(r−1)rn∼ tr−1Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 11 / 18Inference for population mean: µ·Y··− µ·qSSTR(r−1)rn∼ tr−1Why r − 1 degrees of freedom? Imagine we could record aninfinite number of observations for each group, so that Yi·→ µi, orthat σ2α= 0.To learn anything about µ·we still only have r observations(µ1, . . . , µr).Sampling more within an individual cannot narrow the CI for µ·.Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 12 / 18One-way ANOVA (random)Source SS df E(MS)Treatments SSTR =Pri=1n“Yi·− Y··”2r − 1 σ2+ nσ2αError SSE =Pri=1Pnj=1(Yij− Yi·)2(n − 1)r σ2Only change here is the expectation of MSTR which reflectsrandomness of αi’s.ANOVA table is still useful to setup tests: the same F statistics forfixed effect models will work here.Test for random effect: H0: σ2α= 0 based onF =MSTRMSE∼ Fr−1,(n−1)runder H0.Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 13 / 18Estimating σ2αFrom the ANOVA tableσ2α=E(SSTR/(r − 1)) − E(SSE/((n − 1)r ))n.Natural estimate:S2α=SSTR/(r − 1) − SSE/((n − 1)r )nProblem: this estimate can be negative. If it is, set to 0.Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 14 / 18Two-way ANOVA (random)Example: productivity studyImagine a study on the productivity of employees in a largemanufacturing company.Company wants to get an idea of daily productivity, and how itdepends on which machine an employee uses.Study: take m employees and r machines, having each employeework on each machine for a total of n days.As these employees are not all employees, and these machinesare not all machines it makes sense to think of both the effects ofmachine and employees (and interactions) as random.Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 15 / 18Two-way ANOVA (random)Observations, for 1 ≤ i ≤ r, 1 ≤ j ≤ m, 1 ≤ k ≤ n:Yijk∼ µ··+ αi+ βj+ (αβ)ij+ εij,εijk∼ N(0, σ2),αi∼ N(0, σ2α),βj∼ N(0, σ2β),(αβ)ij∼ N(0, σ2αβ).Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 16 / 18Sums of squaresIdentical to fixed effects model of last classSSA = nmrXi=1Yi··− Y···2SSB = nrmXj=1Y·j·− Y···2SSAB = nrXi=1mXj=1Yij·− Yi··− Y·j·+ Y···2Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 17 / 18ANOVA tables: Two-way (random)SS df E(MS)SSA r − 1 σ2+ nmσ2α+ nσ2αβSSB m − 1 σ2+ nrσ2β+ nσ2αβSSAB (m − 1)(r − 1) σ2+ nσ2αβSSE (n − 1)ab σ2To test H0: σ2α= 0 use SSA and SSAB.To test H0: σ2αβ= 0 use SSAB and SSE.Nancy R. Zhang (Statistics 191) Lecture 4 January 24, 2007 18 /


View Full Document

Stanford STATS 191 - Fixed and Random Effect ANOVA

Download Fixed and Random Effect ANOVA
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Fixed and Random Effect ANOVA and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Fixed and Random Effect ANOVA 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?