Poisson Regression. Ryan Godwin. ECON University of Manitoba

Similar documents
MODELING COUNT DATA Joseph M. Hilbe

Parametric Modelling of Over-dispersed Count Data. Part III / MMath (Applied Statistics) 1

Lab 3: Two levels Poisson models (taken from Multilevel and Longitudinal Modeling Using Stata, p )

Testing and Model Selection

Econometric Analysis of Cross Section and Panel Data

Econ 583 Homework 7 Suggested Solutions: Wald, LM and LR based on GMM and MLE

Discrete Dependent Variable Models

Poisson regression 1/15

Lecture 01: Introduction

A Guide to Modern Econometric:

Linear Regression Models P8111

1/15. Over or under dispersion Problem

Statistical Models for Defective Count Data

Maximum Likelihood (ML) Estimation

Generalized Linear Models (1/29/13)

ECONOMETRICS II (ECO 2401S) University of Toronto. Department of Economics. Spring 2013 Instructor: Victor Aguirregabiria

The regression model with one fixed regressor cont d

Statistical Model Of Road Traffic Crashes Data In Anambra State, Nigeria: A Poisson Regression Approach

Greene, Econometric Analysis (6th ed, 2008)

Compare Predicted Counts between Groups of Zero Truncated Poisson Regression Model based on Recycled Predictions Method

DEEP, University of Lausanne Lectures on Econometric Analysis of Count Data Pravin K. Trivedi May 2005

A Generalized Linear Model for Binomial Response Data. Copyright c 2017 Dan Nettleton (Iowa State University) Statistics / 46

Lectures 5 & 6: Hypothesis Testing

Generalized Quasi-likelihood (GQL) Inference* by Brajendra C. Sutradhar Memorial University address:

ST3241 Categorical Data Analysis I Generalized Linear Models. Introduction and Some Examples

From Model to Log Likelihood

Discrete Choice Modeling

Non-linear panel data modeling

Lecture-19: Modeling Count Data II

Generalized Linear Models

Introduction. Dipankar Bandyopadhyay, Ph.D. Department of Biostatistics, Virginia Commonwealth University

MSH3 Generalized linear model Ch. 6 Count data models

Class Notes: Week 8. Probit versus Logit Link Functions and Count Data

Model Based Statistics in Biology. Part V. The Generalized Linear Model. Chapter 16 Introduction

ECON 4160, Autumn term Lecture 1

Partial effects in fixed effects models

Binary choice 3.3 Maximum likelihood estimation

ECONOMETRICS I. Assignment 5 Estimation

STA216: Generalized Linear Models. Lecture 1. Review and Introduction

H-LIKELIHOOD ESTIMATION METHOOD FOR VARYING CLUSTERED BINARY MIXED EFFECTS MODEL

Econometrics Lecture 5: Limited Dependent Variable Models: Logit and Probit

Wooldridge, Introductory Econometrics, 4th ed. Chapter 15: Instrumental variables and two stage least squares

11. Generalized Linear Models: An Introduction

Discrete Choice Modeling

TUTORIAL 8 SOLUTIONS #

Introduction to Econometrics. Heteroskedasticity

Models for Underreporting: A Bernoulli Sampling Approach for Reported Counts

New Developments in Econometrics Lecture 9: Stratified Sampling

Lattice Data. Tonglin Zhang. Spatial Statistics for Point and Lattice Data (Part III)

Practice Problems Section Problems

LECTURE 10: NEYMAN-PEARSON LEMMA AND ASYMPTOTIC TESTING. The last equality is provided so this can look like a more familiar parametric test.

Poisson Regression. Gelman & Hill Chapter 6. February 6, 2017

Generalized Linear Models. Kurt Hornik

A Course in Applied Econometrics Lecture 14: Control Functions and Related Methods. Jeff Wooldridge IRP Lectures, UW Madison, August 2008

Semiparametric Regression

Let us first identify some classes of hypotheses. simple versus simple. H 0 : θ = θ 0 versus H 1 : θ = θ 1. (1) one-sided

Testing Hypothesis. Maura Mezzetti. Department of Economics and Finance Università Tor Vergata

Outline of GLMs. Definitions

Testing Statistical Hypotheses

(a) (3 points) Construct a 95% confidence interval for β 2 in Equation 1.

Some General Types of Tests

1. Hypothesis testing through analysis of deviance. 3. Model & variable selection - stepwise aproaches

Reparametrization of COM-Poisson Regression Models with Applications in the Analysis of Experimental Count Data

Large Sample Properties of Estimators in the Classical Linear Regression Model

2.3 Analysis of Categorical Data

Lecture 8. Poisson models for counts

A Practitioner s Guide to Cluster-Robust Inference

Chapter 22: Log-linear regression for Poisson counts

Chapter 11 The COUNTREG Procedure (Experimental)

NELS 88. Latent Response Variable Formulation Versus Probability Curve Formulation

ECON 4160: Econometrics-Modelling and Systems Estimation Lecture 7: Single equation models

LOGISTIC REGRESSION Joseph M. Hilbe

Economic modelling and forecasting

Generalized Linear Models. Last time: Background & motivation for moving beyond linear

Economics 671: Applied Econometrics Department of Economics, Finance and Legal Studies University of Alabama

Part 1.) We know that the probability of any specific x only given p ij = p i p j is just multinomial(n, p) where p k1 k 2

Statistical Methods III Statistics 212. Problem Set 2 - Answer Key

STAT331. Cox s Proportional Hazards Model

Testing Goodness Of Fit Of The Geometric Distribution: An Application To Human Fecundability Data

Problem Set #6: OLS. Economics 835: Econometrics. Fall 2012

High-Throughput Sequencing Course

Econometrics Multiple Regression Analysis: Heteroskedasticity

Lecture 14: Introduction to Poisson Regression

Modelling counts. Lecture 14: Introduction to Poisson Regression. Overview

Multiple Regression Analysis

Statistics and econometrics

Stat 579: Generalized Linear Models and Extensions

Chapter 2. Review of basic Statistical methods 1 Distribution, conditional distribution and moments

Mathematical statistics

Ninth ARTNeT Capacity Building Workshop for Trade Research "Trade Flows and Trade Policy Analysis"

Parameter Estimation and Statistical Test in Modeling Geographically Weighted Poisson Inverse Gaussian Regression

Constrained Maximum Likelihood Estimation for Model Calibration Using Summary-level Information from External Big Data Sources

Hypothesis testing Goodness of fit Multicollinearity Prediction. Applied Statistics. Lecturer: Serena Arima

Econometrics of Panel Data

Control Function and Related Methods: Nonlinear Models

Generalized Linear. Mixed Models. Methods and Applications. Modern Concepts, Walter W. Stroup. Texts in Statistical Science.

Econometric Analysis of Panel Data. Final Examination: Spring 2018

Common Discrete Distributions

Negative Multinomial Model and Cancer. Incidence

INSTITUTE OF ACTUARIES OF INDIA

Transcription:

Poisson Regression Ryan Godwin ECON 7010 - University of Manitoba Abstract. These lecture notes introduce Maximum Likelihood Estimation (MLE) of a Poisson regression model. 1 Motivating the Poisson Regression Model There are many instances in Econometrics where the variable that we want to explain is a count variable, i.e. y = 0,1,2,... Examples of some cases are: calls at a call-centre number of customers doctor visits bank failures insurance claims patents 1.1 Why not use OLS? OLS will not work very well here. The dependent variable y is not continuous, and y 0. OLS ignores this information (so it will be inefficient). In addition, OLS will not be able to provide very useful predictions (e.g. the probability of a certain count occuring). Instead, a count data model should be used. The Poisson model is a possibility, however, it rarely describes data well in real-world applications. The Poisson model is likely so prevalent due to its relationship to more complicated count data models, rather than for its practical usefulness. 2 The Probability Mass Function (PMF) for a Poisson Distributed Random Variable If y follows a Poisson distribution, then: P(y = y i λ) = λyi e λ y i! ; y = 0,1,2,... ; λ > 0. (1) The mean and variance of this distribution is λ (this equi-dispersion property proves too restrictive for most applications). Provided an estimate for λ, this PMF may be used to infer probabilities of events (e.g. P(y 6)).

2 Ryan Godwin 2.1 Maximum Likelihood Estimation for the Poisson Distribution Assuming independence of the y i s, the joint log-likelihood is: Or: l(λ y i ) = l(λ y i ) = (y i logλ λ logy i!) (2) y i logλ nλ logy i! (3) Taking the derivative of (3) with respect to λ we get: n l λ = y i n (4) λ Setting(4)equaltozeroforthefirstordercondition,andsolvingforλ,yields: λ = ȳ (5) In order to verify that (5) is the MLE for λ we take the second derivative of (3) with respect to λ: 2 n l λ 2 = y i λ 2 (6) Since (6) is negative, the log-likelihood is concave and (5) solves for the global maximum. Note that (6) is the Hessian matrix, H, however, since the Poisson distribution has only one parameter (λ) the Hessian is scalar. 2.2 The Variance of λ The variance of an MLE may be found by taking the inverse of the negative of the expected Hessian matrix (the matrix of second order derivatives and cross derivatives of the log-likelihood). In the present context: var( λ) = [ E(H)] 1 = λ 2 E(yi ) = λ2 nλ = λ n Using the invariance property of MLEs, an MLE for the variance of λ is found by substituting λ into (7): (7) var( λ) = λ n (8)

Poisson Regression 3 2.3 Exercise - Flying-bomb Hits on London During WWII The following data is on number of bomb hits in south London during WWII (Feller, 1957). The city was divided into 576 areas, and the number of areas hit exactly y times was counted. What does the assumption of independence of the data imply here? Table 1. Observed and Expected Counts of Bomb Hits Hits 0 1 2 3 4 5+ Observed 229 211 93 35 7 1 Expected 228 211 98 30 7 1 What is λ? What is calculated? var( λ)? How are the Expected values in the table 2.4 Specification Testing for the Poisson Distribution Goodness-of-fit tests for the Poisson distribution can be achieved by comparing the observed and expected counts. For example, consider the following statistic based on the Pearson statistic: P = (y i λ ) 2 i (9) λ i If the Poisson model is specified correctly, then E[P] = n (or n 1 for a degrees-of-freedom correction). There are several other goodness-of-fit test statistics available based on this idea, and most follow a chi-square distribution. Rejection of the null hypothesis does not indicate the appropriate distribution, only that the Poisson model is misspecified (indicating the loss of some or all of MLs asymptotic properties). The main limitation of the Poisson distribution in applications is it s property of equidispersion. Most count data are overdispersed, i.e. the variance exceeds the mean. Hence, there are several tests based on this restriction. In many cases, there are other candidate distributions that the data may follow (e.g. negative binomial or zero-inflated Poisson), that nest the Poisson distribution. Wald, likelihood ratio, and score testing procedures may be used. 3 The Poisson Regression Model One reason for overdispersion is unobserved heterogeneity. Heterogeneity can become observed by including explanatory variables (in applications this seldom

4 Ryan Godwin accounts for overdispersion). A more important reason for including explanatory variables is to estimate how they are related to y. In addition to the distribution assumption (1), and independence between observations, we will now assume: E[y i x i ] = λ i = exp(x iβ) (10) That is, the mean of y is conditional on x and can vary by individual or observation, etc. The specific form of the link function is somewhat arbitrary, but ensures that λ i > 0. For example, consider the number of doctor visits. An individual s doctor visits may depend on age, underlying health conditions, genetics, and insurance status. The economist may be interested in moral hazard or adverse selection. By substituting (10) into (1), multiplying across all observations (by independence of the data), and taking logs, we have the following joint log-likelihood function: l(β y i,x i ) = y i X iβ expx iβ logy i! (11) The derivative of (11) with respect to the vector, β, is: l n β = (y i expx iβ)x i (12) Setting (12) equal to zero does not admit a closed form solution for β. Hence, numerical methods, such as Newton-Raphson, must be used to obtaining the ML estimate. Note that asymptotic standard errors for the βs can again be estimated by inverting the expected Hessian matrix. 3.1 Interpreting the βs Due to the exponent in the link function, the βs do not have as simple of an interpretation as they do in OLS. For example, a one unit change in the j th regressor leads to a proportionate change in E[y i x i ] of β j. Note that while standard errors for the βs can be estimated by inverting the Hessian, estimating standard errors of the semi-elasticities would require something called the delta method. 3.2 Illustrative Application - Bad Health The data is from the German Health Survey, amended in Hilbe and Greene (2008). The variables are numvisits - number of visits to doctor during 1998, badh - equal to 1 if patient claims to be in bad health, age - age of patient. Enter the following code into R: library(count)

Poisson Regression 5 data(badhealth)) glmbadp <- glm(numvisit summary(glmbadp) badh + age, family=poisson, data=badhealth) References 1. Greene, W. H. (2003). Econometric analysis. Pearson Education India. 2. Hilbe, Joseph M (2011), Negative Binomial Regression, Cambridge University Press Hilbe, J. and W. Greene (2008). Count Response Regression Models, in ed. C.R. Rao, J.P Miller, and D.C. Rao, Epidemiology and Medical Statistics, Elsevier Handbook of Statistics Series. London, UK: Elsevier. 3. Winkelmann, R. (2008). Econometric analysis of count data. Springer Science Business Media.