Unbalanced Nested ANOVA - Sokal & Rohlf Example

Similar documents
Nested 2-Way ANOVA as Linear Models - Unbalanced Example

Biostatistics 360 F&t Tests and Intervals in Regression 1

Statistics for Economics & Business

Department of Quantitative Methods & Information Systems. Time Series and Their Components QMIS 320. Chapter 6

Basic Business Statistics, 10/e

Statistics for Business and Economics

Chapter 11: Simple Linear Regression and Correlation

Comparison of Regression Lines

Lecture 4 Hypothesis Testing

1. Inference on Regression Parameters a. Finding Mean, s.d and covariance amongst estimates. 2. Confidence Intervals and Working Hotelling Bands

F statistic = s2 1 s 2 ( F for Fisher )

Statistics for Managers Using Microsoft Excel/SPSS Chapter 13 The Simple Linear Regression Model and Correlation

Dr. Shalabh Department of Mathematics and Statistics Indian Institute of Technology Kanpur

ANOVA Randomized Block Design

STAT 3008 Applied Regression Analysis

x = , so that calculated

Chapter 13: Multiple Regression

Lecture 6: Introduction to Linear Regression

Interval Estimation in the Classical Normal Linear Regression Model. 1. Introduction

17 - LINEAR REGRESSION II

Y = β 0 + β 1 X 1 + β 2 X β k X k + ε

Chapter 14 Simple Linear Regression

Statistics II Final Exam 26/6/18

Regression. The Simple Linear Regression Model

Joint Statistical Meetings - Biopharmaceutical Section

x i1 =1 for all i (the constant ).

1-FACTOR ANOVA (MOTIVATION) [DEVORE 10.1]

Answers Problem Set 2 Chem 314A Williamsen Spring 2000

Systematic Error Illustration of Bias. Sources of Systematic Errors. Effects of Systematic Errors 9/23/2009. Instrument Errors Method Errors Personal

ANSWERS CHAPTER 9. TIO 9.2: If the values are the same, the difference is 0, therefore the null hypothesis cannot be rejected.

This column is a continuation of our previous column

where I = (n x n) diagonal identity matrix with diagonal elements = 1 and off-diagonal elements = 0; and σ 2 e = variance of (Y X).

Economics 130. Lecture 4 Simple Linear Regression Continued

Lecture Notes for STATISTICAL METHODS FOR BUSINESS II BMGT 212. Chapters 14, 15 & 16. Professor Ahmadi, Ph.D. Department of Management

ECONOMICS 351*-A Mid-Term Exam -- Fall Term 2000 Page 1 of 13 pages. QUEEN'S UNIVERSITY AT KINGSTON Department of Economics

Tests of Single Linear Coefficient Restrictions: t-tests and F-tests. 1. Basic Rules. 2. Testing Single Linear Coefficient Restrictions

Dr. Shalabh Department of Mathematics and Statistics Indian Institute of Technology Kanpur

STATISTICS QUESTIONS. Step by Step Solutions.

First Year Examination Department of Statistics, University of Florida

4 Analysis of Variance (ANOVA) 5 ANOVA. 5.1 Introduction. 5.2 Fixed Effects ANOVA

Chapter 5: Hypothesis Tests, Confidence Intervals & Gauss-Markov Result

ANSWERS. Problem 1. and the moment generating function (mgf) by. defined for any real t. Use this to show that E( U) var( U)

Negative Binomial Regression

UNIVERSITY OF TORONTO Faculty of Arts and Science. December 2005 Examinations STA437H1F/STA1005HF. Duration - 3 hours

Strong Markov property: Same assertion holds for stopping times τ.

Chapter 15 - Multiple Regression

experimenteel en correlationeel onderzoek

The SAS program I used to obtain the analyses for my answers is given below.

STAT 511 FINAL EXAM NAME Spring 2001

Topic- 11 The Analysis of Variance

Chapter 11: I = 2 samples independent samples paired samples Chapter 12: I 3 samples of equal size J one-way layout two-way layout

BOOTSTRAP METHOD FOR TESTING OF EQUALITY OF SEVERAL MEANS. M. Krishna Reddy, B. Naveen Kumar and Y. Ramu

7.1. Single classification analysis of variance (ANOVA) Why not use multiple 2-sample 2. When to use ANOVA

Soc 3811 Basic Social Statistics Third Midterm Exam Spring 2010

Lecture 16 Statistical Analysis in Biomaterials Research (Part II)

Properties of Least Squares

a. (All your answers should be in the letter!

UCLA STAT 13 Introduction to Statistical Methods for the Life and Health Sciences. Chapter 11 Analysis of Variance - ANOVA. Instructor: Ivo Dinov,

[ ] λ λ λ. Multicollinearity. multicollinearity Ragnar Frisch (1934) perfect exact. collinearity. multicollinearity. exact

Basic Statistical Analysis and Yield Calculations

Chapter 15 Student Lecture Notes 15-1

Topic 7: Analysis of Variance

DO NOT OPEN THE QUESTION PAPER UNTIL INSTRUCTED TO DO SO BY THE CHIEF INVIGILATOR. Introductory Econometrics 1 hour 30 minutes

Topic 23 - Randomized Complete Block Designs (RCBD)

Dr. Shalabh Department of Mathematics and Statistics Indian Institute of Technology Kanpur

See Book Chapter 11 2 nd Edition (Chapter 10 1 st Edition)

Correlation and Regression. Correlation 9.1. Correlation. Chapter 9

ECON 351* -- Note 23: Tests for Coefficient Differences: Examples Introduction. Sample data: A random sample of 534 paid employees.

17 Nested and Higher Order Designs

Chapter 12 Analysis of Covariance

/ n ) are compared. The logic is: if the two

Here is the rationale: If X and y have a strong positive relationship to one another, then ( x x) will tend to be positive when ( y y)

Diagnostics in Poisson Regression. Models - Residual Analysis

[The following data appear in Wooldridge Q2.3.] The table below contains the ACT score and college GPA for eight college students.

Introduction to Analysis of Variance (ANOVA) Part 1

Lecture 9: Linear regression: centering, hypothesis testing, multiple covariates, and confounding

Lecture 9: Linear regression: centering, hypothesis testing, multiple covariates, and confounding

Reduced slides. Introduction to Analysis of Variance (ANOVA) Part 1. Single factor

Statistics Chapter 4

Learning Objectives for Chapter 11

# c i. INFERENCE FOR CONTRASTS (Chapter 4) It's unbiased: Recall: A contrast is a linear combination of effects with coefficients summing to zero:

Econ107 Applied Econometrics Topic 3: Classical Model (Studenmund, Chapter 4)

Predictive Analytics : QM901.1x Prof U Dinesh Kumar, IIMB. All Rights Reserved, Indian Institute of Management Bangalore

Linear Approximation with Regularization and Moving Least Squares

Logistic regression with one predictor. STK4900/ Lecture 7. Program

Durban Watson for Testing the Lack-of-Fit of Polynomial Regression Models without Replications

NANYANG TECHNOLOGICAL UNIVERSITY SEMESTER I EXAMINATION MTH352/MH3510 Regression Analysis

Exam. Econometrics - Exam 1

U-Pb Geochronology Practical: Background

Correlation and Regression

Statistics Spring MIT Department of Nuclear Engineering

Scatter Plot x

THE ROYAL STATISTICAL SOCIETY 2006 EXAMINATIONS SOLUTIONS HIGHER CERTIFICATE

ECONOMETRICS - FINAL EXAM, 3rd YEAR (GECO & GADE)

Biostatistics. Chapter 11 Simple Linear Correlation and Regression. Jing Li

Hydrological statistics. Hydrological statistics and extremes

Laboratory 1c: Method of Least Squares

Two-factor model. Statistical Models. Least Squares estimation in LM two-factor model. Rats

Implicit Integration Henyey Method

Regression Analysis. Regression Analysis

Transcription:

8 Lnear Models 3 SR Box.6 Nested ANOVA ORIGIN Unbalanced Nested ANOVA - Sokal & Rohlf Example prepared by Wm Sten Ths sheet offers prototyped example of "Full Sb" nested ANOVA appearng n Sokal & Rohlf Bometry 3 rd Edton (SR) for comparson of ther Least Squares drect approach n Box.6. wth Reduced Maxmum Lklhood estmaton results of lme() {nlme} functon n R, descrbed by J.C. Pnhero & D.M. Bates Mxed-Effects Models n S and S-Plus (PB). Varance Components are calculated comparng quanttes n SR wth equvalent formulas n M. Lynch & B. Walsh 998 (LW) Genetcs and analyss of quanttatve trats, Chapter 8. Readng Data: X READPRN ( "/Data/SRBox.6.txt" ) ^ Data reformatted wth col =Dam, =Sre, =PH response, 3=Sre means. A READPRN ( "/Data/SRBox.6DamMeans.txt" ) ^ Independent factor Dam wth col =Dam means, =n. B READPRN ( "/Data/SRBox.6LtMeans.txt" ) ^ Nested factor Sre (Ltter) wth col =Sre means, =n j, =Dam means. GM mean X GM ^ grand mean Sums of Squares: ndependent factor: SS B nested factor: length A a length A n A AM A < n & means n AM GM SS A j length B b length B X B n B BM B AM B < n j, B means j, & A means SS B n BM AM SS j j j B j SS E wthn nested error: k length X r length X O X AM X 3 SS E O AM SS k k E k SS T Total SS: < Response k, B means k SS T O GM SS k T SS k A SS B SS E A

8 Lnear Models 3 SR Box.6 Nested ANOVA ANOVA Table: Sums of Squares: degrees of freedom: Mean Squares: df A a df A MS A MS A dfaa SS B(A) SS E SS B df B b a SS B df B MS B dfbb SS E df E r b SS E df E MS E dfee MS B MS E SS T SS T df T r df T ^ These values verfed SR p. 96. Tests of Sgnfcance: Usng Full and Reduced Lnear Models approach KNNL. For effect n ndependent varable A: Null Hypothess and Alternatve: H : Regresson coeffcent for Treatment A s zero - no ndependent effect n A H : Regresson coeffcent not zero - treatment effect s evdent n A Test Statstc: MS A F a MSEE MS A F a F a MSB B F a < verfed SR p. 96 Decson Rule: ^ fxed effects denomnator ^ random effects denomnator.5 < set as desred (wthout Satterthwath's correcton) If Fs > F(-df A, df E ) then Reject H, otherwse accept H qf df A df E Probablty: pff a df A P mn pf F a df A df E df E P For effect n nested varable B(A): Null Hypothess and Alternatve: H : Regresson coeffcent for Nested B s zero - no effect for nested B(A) H : Regresson coeffcent not zero - effect evdent n B(A) Test Statstc: Decson Rule:.5 MS B F b MSE E < set as desred F b < verfed SR p. 97 If Fs > F(-df B, df E ) then Reject H, otherwse accept H qf df B df E Probablty: pff b df B P mn pf F b df B df E df E P

8 Lnear Models 3 SR Box.6 Nested ANOVA 3 Calculatng Varance Components: 4 4 Calculatons based on LW pp. 573-574. Equvalent notaton: 5 4 a number of outer factor (Dams) N a N 3 4 4 5 3 b b number of nner factor (Sres) Mbar Mbar 3 4 4 a r total number of ndvduals T r T 3 5 4 3 3 57 5 lengtha 3 4 4 5 3 5 3 4 5 5 3 57 3 66 BB 3 5 BB 34 BB k T 4 4 3 N ( Mbar ) k A SR n 5 4 4 5 A 5 5 4 BB BB k 5 4 3 5 N A k T 3 57 SR n ' 3 5 3 4 3 75 3 4 4 5 A 3 5 5 5 k 3 T k 3 N T ^ Note: One must use SR (nb) ^n j 's from counts n B correcton (from SR) ^ n 's ^ number of sres wthn dams of LW Table 8.3 for k 3 : T (not N) n denomnator ^ values verfed SR p. 97 From SR pp 96-97 Intermedate calculaton quanttes -4: q r q BB q q q3 A q3 q4 BB A From LW Eq. 8.3a-c & Table 8.3: Mean Squares Expected MS Expected Varance Components q4 MS A br r MS B r MS E MS A MS E s A MS B MS E s B k s E MS E k k k 3 MS B MS E s A s B s E values verfed SR p. 98 ^

8 Lnear Models 3 SR Box.6 Nested ANOVA 4 Prototype n R: lbrary(nlme) # {nlme} for lme() & nvervals() lbrary(ape) # {ape} for varcomp() #lbrary(help=ape) # prototype for fndng package ndex #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #CALCULATING VARIANCE COMPONENTS #READ STRUCTURED DATA TABLE WITH NUMERIC CODED NESTED FACTORS K=read.table("c:/8LnearModelsData/SRBox.6NEWR.txt") K aach(k) Y=PH #response varable A=factor(Dam) #OUTER FACTOR A B=factor(Sre) #INNER FACTOR B nsde A r=dm(k)[[]] #TOTAL NUMBER OF INDIVIDUALS r #quanty n SR BB=summary(B) BBsq=BB^ q=sum(bbsq) q a=length(levels(a)) AA=summary(A) AAsq=AA^ q3=sum(aasq) #quanty n SR q3 #quanty 3 n SR b=length(levels(b)) L=table(A,B) BBsum=rowSums(L^) M=BBsum/AA q4=sum(m) q4 #quanty 4 n SR k= (/(a*((b/a) )))*(r q4) k #quanty k n LW k= (/(a ))*(q4 (q/r)) k #quanty k n LW k3= (/(a ))*(r (q3/r)) k3 #quanty k3 n LW > r #quanty n SR [] 6 > q #quantty n SR [] 78 > q3 #quanty 3 n SR [] 8 > q4 #quanty 4 n SR [] 65.68956 > k #quanty k n LW [] 4.86838 > k #quanty k n LW [] 4.3764 > k3 #quanty k3 n LW [].65

8 Lnear Models 3 SR Box.6 Nested ANOVA 5 #LEAST SQUARES VARIANCE COMPONENTS: sga = (MSA-MSE-(k/k)*(MSB-MSE))/k3 sga #varance component for outsde factor A sgb = (MSB-MSE)/k sgb #varance component for nested factor B nsde A sge = MSE sge #varance component for error LEASTSQvar=c(sgA,sgB,sgE) #MAXIMUM LIKLIHOOD VARIANCE COMPONENTS usng lme(): FMe=lme(Y~,random=~ A/B,data=K) FMe summary(fme) varcomp(fme) # {ape} Varance Components calculated MAXLIKvar=c(varcomp(FMe)[],varcomp(FMe)[],varcomp(FMe)[3]) ntervals(fme) # {nlme} PB Confdence Intervals PBINTlower=c(ntervals(FMe)$reStruct$A[,]^, ntervals(fme)$restruct$b[,]^, ntervals(fme)$sgma[]^) PBINTest =c(ntervals(fme)$restruct$a[,]^, ntervals(fme)$restruct$b[,]^, ntervals(fme)$sgma[]^) PBINTupper = c(ntervals(fme)$restruct$a[,3]^, ntervals(fme)$restruct$b[,3]^, ntervals(fme)$sgma[3]^) results=cbnd(ms,leastsqvar,maxlikvar,pbintlower,pbintest,pbintupper) #LEAST SQUARES AND MAXIMUM LIKLIHOOD ESTIMATES OF VARIANCE COMPONENTS: results detach(k) RETURNS: > #LEAST SQUARES AND MAXIMUM LIKLIHOOD ESTIMATES OF VARIANCE COMPONENTS: > results MS LEASTSQvar MAXLIKvar PBINTlower PBINTest PBINTupper A 7.556 8.588 8.895675 3.4687 8.895675 6.76 B 36.3744.7495.64557.367645.64557 9.6683 Wthn 4.7364 4.73643 4.87877 9.35579 4.87877 3.86 KEY TO THE ABOVE TABLE: MS: mean squares from lm() anova() table. LEASTSQvar: Least Squares Varance Components calculated from SR & LW formulas. MAXLIKvar: REML varance components reported by varcomp() {ape}. PBINT: Approxmate 95% Confdence Interval reported by ntervals() {nlme}. (Note all values n ntervals() are reported n Standard Devatons, so are squared n ths table to allow drect comparson wth other values. ) PBINTlower: lower C.I. lmt. PBINTest: Pont Estmate from ntervals() {nlme}. PBINTupper: upper C.I. lmt.