STAT763: Applied Regression Analysis. Multiple linear regression. 4.4 Hypothesis testing

Similar documents
Outline. Remedial Measures) Extra Sums of Squares Standardized Version of the Multiple Regression Model

Biostatistics 380 Multiple Regression 1. Multiple Regression

Ch 3: Multiple Linear Regression

STA 4210 Practise set 2b

Multiple Linear Regression

Linear models and their mathematical foundations: Simple linear regression

STAT5044: Regression and Anova

Chapter 12 - Lecture 2 Inferences about regression coefficient

Chapter 8: Hypothesis Testing Lecture 9: Likelihood ratio tests

Inferences for Regression

STA 4210 Practise set 2a

Math 423/533: The Main Theoretical Topics

Ch 2: Simple Linear Regression

PubH 7405: REGRESSION ANALYSIS. MLR: INFERENCES, Part I

Inference for Regression

School of Mathematical Sciences. Question 1

Correlation Analysis

Sections 7.1, 7.2, 7.4, & 7.6

Lecture 15 Multiple regression I Chapter 6 Set 2 Least Square Estimation The quadratic form to be minimized is

MATH 644: Regression Analysis Methods

Lecture 15. Hypothesis testing in the linear model

Lecture 6 Multiple Linear Regression, cont.

Final Review. Yang Feng. Yang Feng (Columbia University) Final Review 1 / 58

MA 575 Linear Models: Cedric E. Ginestet, Boston University Midterm Review Week 7

6. Multiple Linear Regression

Figure 1: The fitted line using the shipment route-number of ampules data. STAT5044: Regression and ANOVA The Solution of Homework #2 Inyoung Kim

We like to capture and represent the relationship between a set of possible causes and their response, by using a statistical predictive model.

LECTURE 5 HYPOTHESIS TESTING

CAS MA575 Linear Models

" M A #M B. Standard deviation of the population (Greek lowercase letter sigma) σ 2

Nested 2-Way ANOVA as Linear Models - Unbalanced Example

Lecture 18 MA Applied Statistics II D 2004

Chapter 3: Multiple Regression. August 14, 2018

Topic 22 Analysis of Variance

AMS 315/576 Lecture Notes. Chapter 11. Simple Linear Regression

Formal Statement of Simple Linear Regression Model

Lecture 13 Extra Sums of Squares

ST430 Exam 2 Solutions

Lecture 1: Linear Models and Applications

Problems. Suppose both models are fitted to the same data. Show that SS Res, A SS Res, B

Lecture 10 Multiple Linear Regression

Basic Business Statistics 6 th Edition

Unbalanced Data in Factorials Types I, II, III SS Part 1

Chapter 14 Student Lecture Notes Department of Quantitative Methods & Information Systems. Business Statistics. Chapter 14 Multiple Regression

Linear regression. We have that the estimated mean in linear regression is. ˆµ Y X=x = ˆβ 0 + ˆβ 1 x. The standard error of ˆµ Y X=x is.

STAT 540: Data Analysis and Regression

Analysis of Covariance. The following example illustrates a case where the covariate is affected by the treatments.

Table 1: Fish Biomass data set on 26 streams

Estimating σ 2. We can do simple prediction of Y and estimation of the mean of Y at any value of X.

Political Science 236 Hypothesis Testing: Review and Bootstrapping

Regression Analysis. Regression: Methodology for studying the relationship among two or more variables

Mathematical Notation Math Introduction to Applied Statistics

STAT 213 Interactions in Two-Way ANOVA

Applied Regression Analysis

Handout 4: Simple Linear Regression

Statistical Inference. Part IV. Statistical Inference

No other aids are allowed. For example you are not allowed to have any other textbook or past exams.

2. Regression Review

Concordia University (5+5)Q 1.

Section 4.6 Simple Linear Regression

Variance Decomposition and Goodness of Fit

14 Multiple Linear Regression

STAT420 Midterm Exam. University of Illinois Urbana-Champaign October 19 (Friday), :00 4:15p. SOLUTIONS (Yellow)

STA 108 Applied Linear Models: Regression Analysis Spring Solution for Homework #6

F-tests and Nested Models

Lecture 18: Analysis of variance: ANOVA

MEI Exam Review. June 7, 2002

ST430 Exam 1 with Answers

Chapter 4. Regression Models. Learning Objectives

The Multiple Regression Model

PART I. (a) Describe all the assumptions for a normal error regression model with one predictor variable,

Matrix Approach to Simple Linear Regression: An Overview

The linear model is the most fundamental of all serious statistical models encompassing:

Chapter 11 - Lecture 1 Single Factor ANOVA

Master s Written Examination - Solution

Homework 2: Simple Linear Regression

Workshop 7.4a: Single factor ANOVA

Chapter 14. Linear least squares

Statistics for Managers using Microsoft Excel 6 th Edition

Simple Regression Model Setup Estimation Inference Prediction. Model Diagnostic. Multiple Regression. Model Setup and Estimation.

Master s Written Examination

(ii) Scan your answer sheets INTO ONE FILE only, and submit it in the drop-box.

STAT2012 Statistical Tests 23 Regression analysis: method of least squares

Example: Poisondata. 22s:152 Applied Linear Regression. Chapter 8: ANOVA

INTERVAL ESTIMATION AND HYPOTHESES TESTING

36-707: Regression Analysis Homework Solutions. Homework 3

I i=1 1 I(J 1) j=1 (Y ij Ȳi ) 2. j=1 (Y j Ȳ )2 ] = 2n( is the two-sample t-test statistic.

Lectures on Simple Linear Regression Stat 431, Summer 2012

Basic Business Statistics, 10/e

Analysis of Variance Bios 662

Simple and Multiple Linear Regression

Area1 Scaled Score (NAPLEX) .535 ** **.000 N. Sig. (2-tailed)

Formulary Applied Econometrics

UNIVERSITY OF MASSACHUSETTS. Department of Mathematics and Statistics. Basic Exam - Applied Statistics. Tuesday, January 17, 2017

Statistics 203: Introduction to Regression and Analysis of Variance Course review

Foundations of Statistical Inference

Correlation and the Analysis of Variance Approach to Simple Linear Regression

8. Hypothesis Testing

UNIVERSITY OF TORONTO SCARBOROUGH Department of Computer and Mathematical Sciences Midterm Test, October 2013

Variance Decomposition in Regression James M. Murray, Ph.D. University of Wisconsin - La Crosse Updated: October 04, 2017

Transcription:

STAT763: Applied Regression Analysis Multiple linear regression 4.4 Hypothesis testing Chunsheng Ma E-mail: cma@math.wichita.edu

4.4.1 Significance of regression Null hypothesis (Test whether all β j = 0, j = 1,..., k) H 0 : β 1 = β 2 =... = β k = 0

4.4.1 Significance of regression Null hypothesis (Test whether all β j = 0, j = 1,..., k) H 0 : β 1 = β 2 =... = β k = 0 Alternative hypothesis H a : Not all βs are equal to zero

4.4.1 Significance of regression Null hypothesis (Test whether all β j = 0, j = 1,..., k) H 0 : β 1 = β 2 =... = β k = 0 Alternative hypothesis H a : Not all βs are equal to zero Test statistic F = MS R MS Res

4.4.1 Significance of regression Null hypothesis (Test whether all β j = 0, j = 1,..., k) H 0 : β 1 = β 2 =... = β k = 0 Alternative hypothesis H a : Not all βs are equal to zero Test statistic F = MS R MS Res ANOVA table Source SS df MS Test statistic Regression SS R k MS R F Residuals SS Res n-k-1 MS Res Total SS T n-1

Delivery time data (Example 3.1) y = c(16.68, 11.50, 12.03, 14.88, 13.75, 18.11, 8.00, 17.83, 79.24, 21.50, 40.33, 21.00, 13.50, 19.75, 24.00,29.00, 15.35, 19.00, 9.50, 35.10, 17.90, 52.32, 18.75, 19.83, 10.75) x1 = c(7, 3, 3, 4, 6, 7, 2, 7, 30, 5, 16, 10, 4, 6, 9, 10, 6, 7, 3, 17, 10, 26, 9, 8, 4) x2 = c(560, 220, 340, 80, 150, 330, 110, 210, 1460, 605, 688, 215, 255, 462, 448, 776, 200, 132, 36, 770, 140, 810, 450, 635, 150) myfit = lm ( y ~ x1+x2)

ANOVA table > anova (myfit) Analysis of Variance Table Response: y Df Sum Sq Mean Sq F value Pr(>F) x1 1 5382.4 5382.4 506.619 < 2.2e-16 x2 1 168.4 168.4 15.851 0.0006312 Residuals 22 233.7 10.6

ANOVA table > anova (myfit) Analysis of Variance Table Response: y Df Sum Sq Mean Sq F value Pr(>F) x1 1 5382.4 5382.4 506.619 < 2.2e-16 x2 1 168.4 168.4 15.851 0.0006312 Residuals 22 233.7 10.6 From the above table, we obtain SS Res = 233.7, or > anova(myfit)[3,2] [1] 233.7317

SS R SS R = 5382.4 + 168.4 = 5550.8, or > SS_R = anova(myfit)[1,2]+anova(myfit)[2,2] [1] 5550.811

SS R SS R = 5382.4 + 168.4 = 5550.8, or > SS_R = anova(myfit)[1,2]+anova(myfit)[2,2] [1] 5550.811 The observed F value F = SS R/2 = 5550.8/2 = 261.8302 MS Res 10.6

SS R SS R = 5382.4 + 168.4 = 5550.8, or > SS_R = anova(myfit)[1,2]+anova(myfit)[2,2] [1] 5550.811 The observed F value F = SS R/2 = 5550.8/2 = 261.8302 MS Res 10.6 MS_R = SS_R/(anova(myfit)[1,1]+anova(myfit)[2,1]) F = MS_R/anova(myfit)[3,3]

SS R SS R = 5382.4 + 168.4 = 5550.8, or > SS_R = anova(myfit)[1,2]+anova(myfit)[2,2] [1] 5550.811 The observed F value F = SS R/2 = 5550.8/2 = 261.8302 MS Res 10.6 MS_R = SS_R/(anova(myfit)[1,1]+anova(myfit)[2,1]) F = MS_R/anova(myfit)[3,3] p-value (tail probability) > 1-pf(F,2,22) [1] 4.440892e-16 P(F 2,22 > observed F value)

Two ways to make decision (1) Report p value, which is evaluated from the data. A small p-value leads to reject H 0. (2) Use the significance level α, which is previously given. Take α = 0.05, say. From the F table, we find the threshold, qf (1 0.05, 2, 22) > qf(1-0.05,2,22) [1] 3.443357 Then, compare the observed F value with this threshold. Finally, make the decision.

Derive the F test via the likelihood-ratio-test method H 0 : β 1 = β 2 =... = β k = 0 H a : Not all βs are equal to zero The whole parameter space in this case is Θ = {(β 0, β 1,..., β k, σ 2 ) : (β 0, β 1,..., β k ) R k+1, σ 2 (0, )}

Derive the F test via the likelihood-ratio-test method H 0 : β 1 = β 2 =... = β k = 0 H a : Not all βs are equal to zero The whole parameter space in this case is Θ = {(β 0, β 1,..., β k, σ 2 ) : (β 0, β 1,..., β k ) R k+1, σ 2 (0, )} The parameter space associated with H 0 is Θ 0 = {(β 0, 0,..., 0, σ 2 ) : β 0 R, σ 2 (0, )}

Derive the F test via the likelihood-ratio-test method H 0 : β 1 = β 2 =... = β k = 0 H a : Not all βs are equal to zero The whole parameter space in this case is Θ = {(β 0, β 1,..., β k, σ 2 ) : (β 0, β 1,..., β k ) R k+1, σ 2 (0, )} The parameter space associated with H 0 is Θ 0 = {(β 0, 0,..., 0, σ 2 ) : β 0 R, σ 2 (0, )} Likelihood function of parameter (β 0, β 1,..., β k, σ 2 ) { l(β 0, β 1,..., β k, σ 2 1 ) = ( 2πσ) exp 1 } n 2σ 2 (Y Xβ) (Y Xβ)

Likelihood ratio Λ = sup l(β 0, β 1,..., β k, σ 2 ) Θ 0 sup l(β 0, β 1,..., β k, σ 2 ) Θ

Likelihood ratio Λ = sup l(β 0, β 1,..., β k, σ 2 ) Θ 0 sup l(β 0, β 1,..., β k, σ 2 ) Θ sup l(β 0, β 1,..., β k, σ 2 ) = l Θ 0 ( ȳ, 0,..., 0, 1 n i=1 ( = l ȳ, 0,..., 0, 1 n SS T ) n (y i ȳ) 2 )

Likelihood ratio Λ = sup l(β 0, β 1,..., β k, σ 2 ) Θ 0 sup l(β 0, β 1,..., β k, σ 2 ) Θ sup l(β 0, β 1,..., β k, σ 2 ) = l Θ 0 ( ȳ, 0,..., 0, 1 n i=1 ( = l ȳ, 0,..., 0, 1 n SS T ) n (y i ȳ) 2 ) ( ) sup l(β 0, β 1,..., β k, σ 2 ) = l ˆβ 0, ˆβ 1,..., ˆβ k, 1 n (y i ŷ i ) 2 Θ n i=1 ( = l ˆβ 0, ˆβ 1,..., ˆβ k, 1 ) n SS Res

The likelihood ratio Λ = = sup l(β 0, β 1,..., β k, σ 2 ) Θ 0 sup l(β 0, β 1,..., β k, σ 2 ) Θ ( ) n k 1 + n k 1 F 2, which is a decreasing function of F.

The likelihood ratio Λ = = sup l(β 0, β 1,..., β k, σ 2 ) Θ 0 sup l(β 0, β 1,..., β k, σ 2 ) Θ ( ) n k 1 + n k 1 F 2, which is a decreasing function of F. Thus, a larger F would lead us to conclude H a.

4.4.2 Test whether a single β j = 0 H 0 : β j = 0 H a : β j 0 Two ways for this hypothesis testing question (1). Student s t test T = ˆβ j s{ ˆβ j } The corresponding value can be obtained in R by summary(lm(y x1+...)), where s{ ˆβ j } is the standard error of ˆβ j.

Rational A Student s t variable is formulated based on the following three facts ˆβ j N ( β j, σ 2 (X X) 1 ) ˆβj β j+1,j+1, or j N(0, 1) σ 2 (X X) 1 j+1,j+1

Rational A Student s t variable is formulated based on the following three facts ˆβ j N ( β j, σ 2 (X X) 1 ) ˆβj β j+1,j+1, or j N(0, 1) SS Res σ 2 χ 2 n k 1, σ 2 (X X) 1 j+1,j+1

Rational A Student s t variable is formulated based on the following three facts ˆβ j N ( β j, σ 2 (X X) 1 ) ˆβj β j+1,j+1, or j N(0, 1) SS Res σ 2 χ 2 n k 1, ˆβ j and SS Res are independent each other. σ 2 (X X) 1 j+1,j+1

Rational A Student s t variable is formulated based on the following three facts ˆβ j N ( β j, σ 2 (X X) 1 ) ˆβj β j+1,j+1, or j N(0, 1) SS Res σ 2 χ 2 n k 1, ˆβ j and SS Res are independent each other. σ 2 (X X) 1 j+1,j+1 Student s t variable or ˆβ j β j σ 2 (X X) 1 j+1,j+1 SS Res t n k 1 σ /(n k 1) 2 ˆβ j β j MS Res (X X) 1 j+1,j+1 = ˆβ j β j s( ˆβ j ) t n k 1

When H 0 : β j = 0 is true, ˆβ j s( ˆβ j ) t n k 1, where s( ˆβ j ) = MS Res (X X) 1 j+1,j+1 Test statistic for H 0 : β j = 0 T = ˆβ j s( ˆβ j ) Two ways could be used to make a decision: p-value or significance level.

(2). Partial F test F test statistic F = SS R(X j X 1,..., X j 1, X j+1,..., X k ) 1 = SS R(X j X 1,..., X j 1, X j+1,..., X k ) MS Res SS Res(X 1,..., X k ) n k 1 SS R (X j X 1,..., X j 1, X j+1,..., X k ) = SS R (use all predictor variables in the model) SS R (use predictor variables X 1,..., X j 1, X j+1,..., X k )

Sum of squares SS T : WITHOUT taking any predictor variables into account. n SS T = (Y i Ȳ )2 i=1

Sum of squares SS T : WITHOUT taking any predictor variables into account. n SS T = (Y i Ȳ )2 i=1 (i) Taking X 1 into account, Y is regressed on X 1 alone (simple linear regression). SS R (X 1 ) = the regression sum of squares when X 1 only is in the model SS Res (X 1 ) = the error sum of squares when X 1 only is in the model SS T = SS R (X 1 ) + SS Res (X 1 ).

Sum of squares SS T : WITHOUT taking any predictor variables into account. n SS T = (Y i Ȳ )2 i=1 (i) Taking X 1 into account, Y is regressed on X 1 alone (simple linear regression). SS R (X 1 ) = the regression sum of squares when X 1 only is in the model SS Res (X 1 ) = the error sum of squares when X 1 only is in the model SS T = SS R (X 1 ) + SS Res (X 1 ). (ii) Taking both X 1 and X 2 into account, Y is now regressed on X 1 and X 2 (two predictor variables). SS R (X 1, X 2 ) = the regression sum of squares when X 1 and X 2 are in the model SS Res (X 1, X 2 ) = the error sum of squares when X 1 and X 2 are in the model SS T = SS R (X 1, X 2 ) + SS Res (X 1, X 2 ).

Questions Which one is larger, SS Res (X 1 ) or SS Res (X 1, X 2 )? Which one is larger, SS R (X 1 ) or SS R (X 1, X 2 )?

Questions Which one is larger, SS Res (X 1 ) or SS Res (X 1, X 2 )? Which one is larger, SS R (X 1 ) or SS R (X 1, X 2 )? Answers SS Res (X 1 ) SS Res (X 1, X 2 ) SS R (X 1 ) SS R (X 1, X 2 )

Questions Which one is larger, SS Res (X 1 ) or SS Res (X 1, X 2 )? Which one is larger, SS R (X 1 ) or SS R (X 1, X 2 )? Answers SS Res (X 1 ) SS Res (X 1, X 2 ) Extra sum of squares SS R (X 1 ) SS R (X 1, X 2 ) SS Res (X 2 X 1 ) = SS Res (X 1 ) SS Res (X 1, X 2 ) It measures the marginal effect of adding X 2 to the regression model, when X 1 is already in the model (and X 2 is regarded as an extra variable). SS R (X 2 X 1 ) = SS R (X 1, X 2 ) SS R (X 1 ) it is the marginal increase in the regression sum of squares.

Questions Which one is larger, SS Res (X 1 ) or SS Res (X 1, X 2 )? Which one is larger, SS R (X 1 ) or SS R (X 1, X 2 )? Answers SS Res (X 1 ) SS Res (X 1, X 2 ) Extra sum of squares SS R (X 1 ) SS R (X 1, X 2 ) SS Res (X 2 X 1 ) = SS Res (X 1 ) SS Res (X 1, X 2 ) It measures the marginal effect of adding X 2 to the regression model, when X 1 is already in the model (and X 2 is regarded as an extra variable). SS R (X 2 X 1 ) = SS R (X 1, X 2 ) SS R (X 1 ) it is the marginal increase in the regression sum of squares. SSTO = SSR(X 1 ) + SSR(X 2 X 1 ) + SSE(X 1, X 2 )

4.4.3 Test several β j = 0, j = 1,..., r H 0 : β 1 =... = β r = 0 H a : not all β j 0

4.4.3 Test several β j = 0, j = 1,..., r H 0 : β 1 =... = β r = 0 H a : not all β j 0 Test statistic F = SS R(X 1,..., X r X r+1,..., X k ) r = SS R(X 1,..., X r X r+1,..., X k ) r MS Res SS Res(X 1,..., X k ) n k 1 SS R (X 1,..., X r X r+1,..., X k ) = SS R (use all predictor variables in the model) SS R (use predictor variables X r+1,..., X k ) = SS Res (use predictor variables X r+1,..., X k ) SS Res (use all predictor variables in the model)

Derive the F test via the likelihood-ratio-test method H 0 : β 1 = β 2 =... = β r = 0 H 1 : Not all βs are equal to zero The whole parameter space in this case is Θ = {(β 0, β 1,..., β k, σ 2 ) : (β 0, β 1,..., β k ) R k+1, σ 2 (0, )}

Derive the F test via the likelihood-ratio-test method H 0 : β 1 = β 2 =... = β r = 0 H 1 : Not all βs are equal to zero The whole parameter space in this case is Θ = {(β 0, β 1,..., β k, σ 2 ) : (β 0, β 1,..., β k ) R k+1, σ 2 (0, )} The parameter space associated with H 0 is Θ 0 = {(β 0, 0,..., 0, β r+1,..., β k, σ 2 ) : β 0 R, β r+1 R,..., β k R, σ 2 (0, )}

Derive the F test via the likelihood-ratio-test method H 0 : β 1 = β 2 =... = β r = 0 H 1 : Not all βs are equal to zero The whole parameter space in this case is Θ = {(β 0, β 1,..., β k, σ 2 ) : (β 0, β 1,..., β k ) R k+1, σ 2 (0, )} The parameter space associated with H 0 is Θ 0 = {(β 0, 0,..., 0, β r+1,..., β k, σ 2 ) : β 0 R, β r+1 R,..., β k R, σ 2 (0, )} Likelihood function of parameter (β 0, β 1,..., β k, σ 2 ) { l(β 0, β 1,..., β k, σ 2 1 ) = ( 2πσ) exp 1 } n 2σ 2 (Y Xβ) (Y Xβ)

Likelihood ratio Λ = sup l(β 0, β 1,..., β k, σ 2 ) Θ 0 sup l(β 0, β 1,..., β k, σ 2 ) Θ

Likelihood ratio Λ = sup l(β 0, β 1,..., β k, σ 2 ) Θ 0 sup l(β 0, β 1,..., β k, σ 2 ) Θ sup l(β 0, β 1,..., β k, σ 2 ) = l(, 0,..., 0,,...,,?) Θ 0

Likelihood ratio Λ = sup l(β 0, β 1,..., β k, σ 2 ) Θ 0 sup l(β 0, β 1,..., β k, σ 2 ) Θ sup l(β 0, β 1,..., β k, σ 2 ) = l(, 0,..., 0,,...,,?) Θ 0 ( ) sup l(β 0, β 1,..., β k, σ 2 ) = l ˆβ 0, ˆβ 1,..., ˆβ k, 1 n (y i ŷ i ) 2 Θ n i=1 ( = l ˆβ 0, ˆβ 1,..., ˆβ k, 1 ) n SS Res

The likelihood ratio Λ = sup l(β 0, β 1,..., β k, σ 2 ) Θ 0 sup l(β 0, β 1,..., β k, σ 2 ) Θ = (1+?F ) n 2, which is a decreasing function of F.

The likelihood ratio Λ = sup l(β 0, β 1,..., β k, σ 2 ) Θ 0 sup l(β 0, β 1,..., β k, σ 2 ) Θ = (1+?F ) n 2, which is a decreasing function of F. Thus, a larger F would lead us to conclude H a.