INTRODUCING LINEAR REGRESSION MODELS Response or Dependent variable y

Similar documents
Simple Linear Regression

Simple Linear Regression

Lecture 14 Simple Linear Regression

Scatter plot of data from the study. Linear Regression

Scatter plot of data from the study. Linear Regression

where x and ȳ are the sample means of x 1,, x n

Regression. ECO 312 Fall 2013 Chris Sims. January 12, 2014

Bayesian Inference. Chapter 4: Regression and Hierarchical Models

SCHOOL OF MATHEMATICS AND STATISTICS. Linear and Generalised Linear Models

Bayesian Inference. Chapter 4: Regression and Hierarchical Models

Bayesian Inference. Chapter 9. Linear models and regression

Lecture 15. Hypothesis testing in the linear model

Subject CS1 Actuarial Statistics 1 Core Principles

STAT5044: Regression and Anova. Inyoung Kim

Stat 5101 Lecture Notes

Simple linear regression

13 Simple Linear Regression

Simple Linear Regression

14 Multiple Linear Regression

variability of the model, represented by σ 2 and not accounted for by Xβ

STAT 511. Lecture : Simple linear regression Devore: Section Prof. Michael Levine. December 3, Levine STAT 511

Well-developed and understood properties

Topic 12 Overview of Estimation

The material for categorical data follows Agresti closely.

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

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

Linear models and their mathematical foundations: Simple linear regression

Linear Models A linear model is defined by the expression

Measuring the fit of the model - SSR

STA 2201/442 Assignment 2

Ch 2: Simple Linear Regression

Categorical Predictor Variables

TABLES AND FORMULAS FOR MOORE Basic Practice of Statistics

Regression Models - Introduction

20.1. Balanced One-Way Classification Cell means parametrization: ε 1. ε I. + ˆɛ 2 ij =

Problem Selected Scores

Statistical Modelling in Stata 5: Linear Models

Bayesian Linear Regression

Copula Regression RAHUL A. PARSA DRAKE UNIVERSITY & STUART A. KLUGMAN SOCIETY OF ACTUARIES CASUALTY ACTUARIAL SOCIETY MAY 18,2011

: The model hypothesizes a relationship between the variables. The simplest probabilistic model: or.

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

Categorical data analysis Chapter 5

Analysing data: regression and correlation S6 and S7

9. Linear Regression and Correlation

Multiple Linear Regression

Simple linear 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.

In the bivariate regression model, the original parameterization is. Y i = β 1 + β 2 X2 + β 2 X2. + β 2 (X 2i X 2 ) + ε i (2)

Inference for Regression Inference about the Regression Model and Using the Regression Line, with Details. Section 10.1, 2, 3

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

Exam Applied Statistical Regression. Good Luck!

Correlation Analysis

3. For a given dataset and linear model, what do you think is true about least squares estimates? Is Ŷ always unique? Yes. Is ˆβ always unique? No.

Regression diagnostics

36-707: Regression Analysis Homework Solutions. Homework 3

MFin Econometrics I Session 4: t-distribution, Simple Linear Regression, OLS assumptions and properties of OLS estimators

Statistical Models. ref: chapter 1 of Bates, D and D. Watts (1988) Nonlinear Regression Analysis and its Applications, Wiley. Dave Campbell 2009

An Introduction to Bayesian Linear Regression

STAT5044: Regression and Anova

Regression Analysis Chapter 2 Simple Linear Regression

Homework 2: Simple Linear Regression

y response variable x 1, x 2,, x k -- a set of explanatory variables

Linear regression and correlation

STAT 4385 Topic 03: Simple Linear Regression

Bayesian linear regression

[y i α βx i ] 2 (2) Q = i=1

Stat 5102 Final Exam May 14, 2015

Linear Regression Spring 2014

Chapter 1: Linear Regression with One Predictor Variable also known as: Simple Linear Regression Bivariate Linear Regression

Inference. ME104: Linear Regression Analysis Kenneth Benoit. August 15, August 15, 2012 Lecture 3 Multiple linear regression 1 1 / 58

5. Linear Regression

MATH c UNIVERSITY OF LEEDS Examination for the Module MATH1725 (May-June 2009) INTRODUCTION TO STATISTICS. Time allowed: 2 hours

Simple and Multiple Linear Regression

Table of z values and probabilities for the standard normal distribution. z is the first column plus the top row. Each cell shows P(X z).

Conjugate Analysis for the Linear Model

Quantitative Analysis of Financial Markets. Summary of Part II. Key Concepts & Formulas. Christopher Ting. November 11, 2017

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

ECO220Y Simple Regression: Testing the Slope

Correlation and Linear Regression

FENG CHIA UNIVERSITY ECONOMETRICS I: HOMEWORK 4. Prof. Mei-Yuan Chen Spring 2008

Lecture 10 Multiple Linear Regression

Confidence Intervals, Testing and ANOVA Summary

Simple Linear Regression Analysis

The Slow Convergence of OLS Estimators of α, β and Portfolio. β and Portfolio Weights under Long Memory Stochastic Volatility

Simple Linear Regression

Statistics for exp. medical researchers Regression and Correlation

SSR = The sum of squared errors measures how much Y varies around the regression line n. It happily turns out that SSR + SSE = SSTO.

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

Linear Regression. 1 Introduction. 2 Least Squares

2 Regression Analysis

Part 6: Multivariate Normal and Linear Models

Diagnostics can identify two possible areas of failure of assumptions when fitting linear models.

Bayesian Linear Models

Nature vs. nurture? Lecture 18 - Regression: Inference, Outliers, and Intervals. Regression Output. Conditions for inference.

APTS course: 20th August 24th August 2018

STAT2012 Statistical Tests 23 Regression analysis: method of least squares

Introduction to Statistical Inference Lecture 8: Linear regression, Tests and confidence intervals

COS513: FOUNDATIONS OF PROBABILISTIC MODELS LECTURE 9: LINEAR REGRESSION

Simple Linear Regression: A Model for the Mean. Chap 7

Mathematical Notation Math Introduction to Applied Statistics

Transcription:

INTRODUCING LINEAR REGRESSION MODELS Response or Dependent variable y Predictor or Independent variable x Model with error: for i = 1,..., n, y i = α + βx i + ε i ε i : independent errors (sampling, measurement, lack of fit) Typically ε N(0, σ 2 ) Analysis and inference: Estimate parameters (α, β, σ 2 ) Assess model fit adequate? good? if inadequate, how? Explore implications: β, βx Predict new ( future ) responses at new x n+1,...

BIG PICTURE: Understanding variability in y as a function of x Exploring p(y x) as a function of x One aspect: Regression function E(y x) as x varies Special case: normal, linear in mean Other cases: binomial y, success prob depends on x e.g., logistic regression, dose-response models How much variability does x explain? Normal models: Variance measures variability

Observational studies versus Designed studies Random x versus Controlled x Bivariate data (y i, x i ), but take x i fixed Special status of response variable Several or many predictor variables

SAMPLE SUMMARY STATISTICS Sample means x, ȳ Sample variances s 2 x, s 2 y s 2 y = S yy /(n 1), s 2 x = S xx /(n 1) sample covariance s xy = S xy /(n 1) where the Sums of Squares are: S yy = n i=1 (y i ȳ) 2 Total Variation in response S xx = n i=1 (x i x) 2 S xy = n i=1 (x i x)(y i ȳ)

Standardized scale for covariance: SAMPLE CORRELATION: r = s xy s x s y 1 < r < 1, measure of dependence for a single predictor, r 2 = R 2

SQUARED ERRORS AND FIT OF CHOSEN LINES Measurement error version of model: y i = α + βx i + ε i For any chosen α, β, n n Q(α, β) = ε 2 i = (y i α βx i ) 2 i=1 i=1 measures fit of chosen line α + βx to response data LEAST SQUARES LINE: Choose ˆα, ˆβ to minimise Q(α, β) Geometric interpretation Least squares estimates (LSE) ˆα, ˆβ (Venerable/ad-hoc) principal of least squares estimation Least squares fit is also the MLE

LEAST SQUARES ESTIMATES FACTS: Or ˆβ = s xy s 2 x, ˆα = ȳ ˆβ x ( ) sy ˆβ = r s x ˆβ is correlation coefficient r, corrected for relative scales of y : x so that the units of the fitted values ˆβx are on scale of y Note also ˆβ = S xy S xx of use in theoretical derivations

R 2 measure of model fit: Simplest model: β = ˆβ = 0 so y i are a normal random sample ˆα = ȳ, Q(ȳ, 0) = S yy = total sum of squares Any other model fit: Residual Sum of Squares Q(ˆα, ˆβ) DEFINE: R 2 = 1 Q(ˆα, ˆβ)/S yy proportion of variation explained by model FACT: R 2 = r 2 Multiple regression generalisation later Higher %variation explained is better: Higher correlation Measures linear correlation not general dependence not causation

EXAMINING MODEL FIT Fitted values ŷ i = ˆα + ˆβx i Residuals ˆε i = y i ŷ i estimates of ε i Residual sum of squares Q(ˆα, ˆβ) = n i=1 ˆε2 i measures remaining/residual variation in response data Residual sample variance: s 2 Y X = RSS n 2 = n i=1 ˆε 2 i n 2 s 2 Y X is a point estimate of σ2 from fitted model note: n 2 degrees of freedom, not n 1 lose 2 degrees of freedom for estimation of α, β

Conjugate Priors for Regression Normal is conjugate for α and β Inverse-Gamma is conjugate for σ 2 Common re-parameterization: Precision φ = 1 σ 2 Gamma is conjugate for φ A Reference Prior for Regression Take limits of conjugate prior as the prior variance goes to infinity (information goes to zero) lim t N(0, t) is proportional to a constant lim Γ(a, b) or Γ 1 (a, b) is proportional to the inverse a 0, b 0 p(α, β, σ 2 ) 1 σ 2 p(α, β, φ) 1 φ

THEORY FOR INFERENCE: REFERENCE POSTERIOR Some key aspects of the reference posterior for (α, β, σ 2 ): (marginal) posterior for β is t distribution with n 2 df. where v 2 β = 1/S xx t n 2 ( ˆβ, s 2 Y X v2 β) s 2 Y X is a posterior estimate of σ2 residual variance Key to assessing significance of regression fit and measuring the explanatory power of chosen predictor x Intervals (HPD or equal-tailed): ˆβ ± (sv β )t p/2 where t p/2 is 100(p/2)% quantile of standard t n 2

TESTING SIGNIFICANCE OF THE REGRESSION FIT Question: How probable is β = 0 under the posterior? Answer: Compute posterior probability on β values with lower posterior density than β = 0 Measures probability of β less likely than β = 0 Informal test of significance Probability in tails = significance level = (Bayesian) p value Symmetric posterior density: double one tail area Classical testing terminology: The regression on x is significant at the 5% level (or 1%, etc) if the p value is smaller than 0.05 (or 0.01, etc) R/S-Plus: 2*(1-pt(abs(t), n-2)) where t= ˆβ/s Y X v β standardized T Statistic

F TESTS, ANOVA AND DEVIANCES F test of regression fit: Theory: If t T k (0, 1) then F = t 2 F 1,n 2 So p value = P r(f f obs ) f obs = ˆβ 2 /s 2 Y X v2 β T and F tests are equivalent: same p value S-Plus output: quotes T values, p values in coefficient table and F test result

F TESTS, ANOVA AND DEVIANCES Deviances = Sums of squares: Deviance decomposition: S yy = Q(ˆα, ˆβ) + ˆβ 2 /v 2 β Total deviance S yy = n i=1 (y i ȳ) 2 Residual deviance Q(ˆα, ˆβ) = n i=1 (y i ŷ i ) 2 Fitted or explained deviance: ˆβ2 /v 2 β here equal to s 2 Y X f obs Large deviance explained large F significant regression ANOVA: analysis of variance (deviance)

PREDICTION FROM FITTED MODEL Question: What is the posterior predictive distribution for a new case, y n+1 = α + βx n+1 + ε n+1 Answer: Also a Student t distribution with n 2 df. y n+1 T n 2 (ŷ, s 2 Y X v2 y) Mean is ŷ = ˆα + ˆβx n+1 Spread: s 2 Y X v2 y = s 2 Y X + s2 Y X w2... s 2 Y X w2 posterior uncertainty about α + βx n+1 depends on x n+1, spread is higher for x n+1 far from x additional variability +s 2 Y X due to ε n+1, estimating σ 2 by s 2 Y X Can use S-Plus function predict.lm()

Model fit assessment/implications: Explore predictive distributions Residual analysis: Graphical exploration of fitted residuals ˆε i Standardize: r i = ˆε i / var(ˆε i ) Check normality assumption Treat ˆε i as new data look at structure, other predictors Other predictors?