Linear Regression With Special Variables

Similar documents
Generalized Linear Models Introduction

Single-level Models for Binary Responses

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

Lecture notes to Chapter 11, Regression with binary dependent variables - probit and logit regression

STAT5044: Regression and Anova

Sample Problems. Note: If you find the following statements true, you should briefly prove them. If you find them false, you should correct them.

Generalized Linear Models

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

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

Linear Regression. Junhui Qian. October 27, 2014

Week 7: Binary Outcomes (Scott Long Chapter 3 Part 2)

Logit Regression and Quantities of Interest

STAT 7030: Categorical Data Analysis

Logistic regression. 11 Nov Logistic regression (EPFL) Applied Statistics 11 Nov / 20

Limited Dependent Variable Models II

Introduction to Linear Regression Analysis

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

Logistic Regression and Generalized Linear Models

ECON Interactions and Dummies

Chapter 9 Regression with a Binary Dependent Variable. Multiple Choice. 1) The binary dependent variable model is an example of a

Categorical Predictor Variables

9 Generalized Linear Models

Logit Regression and Quantities of Interest

Binary Logistic Regression

Linear Regression Models P8111

Econometrics II. Seppo Pynnönen. Spring Department of Mathematics and Statistics, University of Vaasa, Finland

Chapter 9. Dummy (Binary) Variables. 9.1 Introduction The multiple regression model (9.1.1) Assumption MR1 is

STA 216: GENERALIZED LINEAR MODELS. Lecture 1. Review and Introduction. Much of statistics is based on the assumption that random

Generalized Linear Models 1

Econometrics I Lecture 7: Dummy Variables

Applied Economics. Regression with a Binary Dependent Variable. Department of Economics Universidad Carlos III de Madrid

Gibbs Sampling in Latent Variable Models #1

4. Nonlinear regression functions

Generalized logit models for nominal multinomial responses. Local odds ratios

Introduction To Logistic Regression

Regression with Qualitative Information. Part VI. Regression with Qualitative Information

Advanced Quantitative Methods: limited dependent variables

Classification. Chapter Introduction. 6.2 The Bayes classifier

CHAPTER 4 & 5 Linear Regression with One Regressor. Kazu Matsuda IBEC PHBU 430 Econometrics

Generalized linear models

Linear model A linear model assumes Y X N(µ(X),σ 2 I), And IE(Y X) = µ(x) = X β, 2/52

BANA 7046 Data Mining I Lecture 4. Logistic Regression and Classications 1

Multiple Regression: Chapter 13. July 24, 2015

Semiparametric Generalized Linear Models

Data-analysis and Retrieval Ordinal Classification

Lecture 14: Introduction to Poisson Regression

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

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

Research Methods in Political Science I

Modeling Binary Outcomes: Logit and Probit Models

MLE for a logit model

Lecture 5: LDA and Logistic Regression

Ch 7: Dummy (binary, indicator) variables

Sections 4.1, 4.2, 4.3

Testing and Model Selection

Chapter 14 Logistic Regression, Poisson Regression, and Generalized Linear Models

LOGISTIC REGRESSION Joseph M. Hilbe

8 Nominal and Ordinal Logistic Regression

ECONOMETRIC MODEL WITH QUALITATIVE VARIABLES

STA 303 H1S / 1002 HS Winter 2011 Test March 7, ab 1cde 2abcde 2fghij 3

Generalized Linear Models for Non-Normal Data

Lecture-20: Discrete Choice Modeling-I

Linear Methods for Prediction

SCHOOL OF MATHEMATICS AND STATISTICS. Linear and Generalised Linear Models

Generalized Linear Models and Exponential Families

Machine Learning. Lecture 3: Logistic Regression. Feng Li.

Lecture 6: Discrete Choice: Qualitative Response

Section 5: Dummy Variables and Interactions

Statistical View of Least Squares

Making sense of Econometrics: Basics

Goals. PSCI6000 Maximum Likelihood Estimation Multiple Response Model 1. Multinomial Dependent Variable. Random Utility Model

Simple Regression Model. January 24, 2011

Maximum Likelihood Methods

Introducing Generalized Linear Models: Logistic Regression

Investigating Models with Two or Three Categories

5. Let W follow a normal distribution with mean of μ and the variance of 1. Then, the pdf of W is

Ron Heck, Fall Week 8: Introducing Generalized Linear Models: Logistic Regression 1 (Replaces prior revision dated October 20, 2011)

12 Modelling Binomial Response Data

Chapter 4: Generalized Linear Models-I

Latent Variable Models for Binary Data. Suppose that for a given vector of explanatory variables x, the latent

Binary Dependent Variable. Regression with a

Lecture 2: Categorical Variable. A nice book about categorical variable is An Introduction to Categorical Data Analysis authored by Alan Agresti

Homework 1 Solutions

Stat 135 Fall 2013 FINAL EXAM December 18, 2013

Econ 444, class 11. Robert de Jong 1. Monday November 6. Ohio State University. Econ 444, Wednesday November 1, class Department of Economics

Dealing With Endogeneity

Advanced Ratemaking. Chapter 27 GLMs

Review: what is a linear model. Y = β 0 + β 1 X 1 + β 2 X 2 + A model of the following form:

11. Generalized Linear Models: An Introduction

Chapter 11. Regression with a Binary Dependent Variable

Models of Qualitative Binary Response

Truck prices - linear model? Truck prices - log transform of the response variable. Interpreting models with log transformation

Econometric Modelling Prof. Rudra P. Pradhan Department of Management Indian Institute of Technology, Kharagpur

Applied Econometrics Lecture 1

LISA Short Course Series Generalized Linear Models (GLMs) & Categorical Data Analysis (CDA) in R. Liang (Sally) Shan Nov. 4, 2014

Problem #1 #2 #3 #4 #5 #6 Total Points /6 /8 /14 /10 /8 /10 /56

Regression and Stats Primer

Practice exam questions

Estimated Precision for Predictions from Generalized Linear Models in Sociological Research

High-Throughput Sequencing Course

Transcription:

Linear Regression With Special Variables Junhui Qian December 21, 2014

Outline Standardized Scores Quadratic Terms Interaction Terms Binary Explanatory Variables Binary Choice Models

Standardized Scores: An Example When we study how salaries depend on IQ score, we may run the following simple regression, log(salary i ) = β 0 + β 1 IQ i + u. What is the economic interpretation of β 1 above? To make the coefficient more meaningful, we can define a new variable z i = IQ i IQ ˆσ IQ and run log(salary i ) = β 0 + β 1 z i + u. Now, what is the economic interpretation of β 1?

Standardized Scores Given a variable x i, the standardized score is defined as z x,i = x i x ˆσ x, where x and ˆσ x are the sample mean and standard deviation, respectively. The coefficient on a standardized score is interpreted as the increase in y when x is one standard deviation higher.

Standardized Score as Dependent Variable The standardized score can also be the dependent variable in a regression. For example, let and run z y,i = y i ȳ ˆσ y, z y,i = β 0 + β 1 x 1 + β 2 x 2 + u. β 1 in this model is interpreted as the increase in y, in terms of standard deviations, with each unit of increase in x 1, holding other factors fixed.

Standardized Coefficients We may need a model where all variables are standardized, for example, z y,i = β 1 z x1,i + β 2 z x2,i + u. The β 1 is interpreted as the increase in y, in terms of standard deviations, when x 1 is one standard deviation higher, holding other factors fixed. Note that we need no constant term in the above model. The β s in such models are called standardized coefficients.

Models with Quadratic Terms We have seen models with quadratic terms. For example, in the income determination model, log(income) = β 0 + β 1 edu + β 2 edu 2 + β 3 expr + u. How do you interpret the parameters β 1 and β 2?

The Level-Dependent Partial Effect In a model with quadratic terms, y = β 0 + β 1 x + β 2 x 2 + u. The partial effect of x on y is dependent on the level of x. To see why, y x = β 1 + 2β 2 x.

Back to Our Example We estimate the model and obtain, log(income) = 7.55 + 0.0715edu + 0.00560edu 2 0.00299expr. We may ask, for a person with 10 years education, how much income increase would be expected if he receives one more year of education?

Interaction Terms Recall that linear regression is the first-order approximation of a usually nonlinear relationship: y = f (x 1, x 2 ) + u β 0 + β 1 x 1 + β 2 x 2 + u. To get better approximations, we may add quadratic terms, y = f (x 1, x 2 )+u β 0 +β 1 x 1 +β 2 x 2 +β 3 x 2 1 +β 4 x 2 2 +β 5 x 1 x 2 +u. β 3 and β 4 measures nonlinearities in x 1 and x 2, and β 5 measures the interaction effect between x 1 and x 2. The term x 1 x 2 is hence called the interaction term.

Interaction Effect There is interaction effect when a change in one explanatory variable may affect the slope of another. For example, in a model of housing price, price = β 0 + β 1 sqft + β 2 rooms + β 3 sqft rooms + β 4 bath + u. The partial effect of rooms on price is β 2 + β 3 sqft. If β 3 > 0, an additional room in a large house is more valuable than that in a small house.

Average Partial Effect In a model with interaction terms, y = β 0 + β 1 x 1 + β 2 x 2 + β 3 x 1 x 2 + u. β 1 is the partial effect of x 1 on y when x 2 = 0. This is not very interesting. Instead, we may be interested in the partial effect of x 1 on y when x 2 = x 2. We may obtain such an average partial effect by plug x 2 in ˆβ 1 + ˆβ 3 x 2. To obtain average partial effect directly, we can run y = β 0 + β 1 x 1 + β 2 x 2 + β 3 (x 1 x 1 )(x 2 x 2 ) + u. Now β 1 is the desired average partial effect.

Binary (Dummy) Variables A binary variable describes qualitative information, in contrast to quantitative information. For example, male or female, urban or rural residence, employed or unemployed, a person buys a car or not, etc. A typical binary variable is defined as female = 0, 1, where 0 corresponds to not female and 1 corresponds to female.

Binary Variable on the Intercept Binary variables may influence the intercept only. For example, in the following model, log(income) = β 0 + β 1 edu + β 2 expr + β 3 female + u, where female is a binary variable. For females, the model is log(income) = (β 0 + β 3 ) + β 1 edu + β 2 expr + u. For males, the model is log(income) = β 0 + β 1 edu + β 2 expr + u. The group of males in this model can be called baseline group.

Binary Variable on the Slope Binary variables may also influence the slope. For example, in the following model, log(income) = β 0 + β 1 edu + β 2 expr + β 3 female edu + u. For females, the model is log(income) = β 0 + (β 1 + β 3 )edu + β 2 expr + u. For males, the model is log(income) = β 0 + β 1 edu + β 2 expr + u.

When There Are Several Categories Binary variables are easily defined when there are two categories. For example, the gender of a person can only be male or female. Other qualitative information may involve more than two categories. For example, to describe the region of the country where people live and work, we may have three categories (coast, middle, west). For another example, to describe seasonality, we have four categories.

When There Are Several Categories Obviously, one binary variable is not enough for more than two categories. The solution is to have more than one binary variables. For example, if there are 3 regions (coast, middle, west) in total, we may consider log(income) = β 0 + β 1 edu + β 2 expr + β 3 west + β 4 middle + u, where west is defined as 1 if the individual is in the west and 0 otherwise. Why not add one more binary variable coast?

Testing the Existence of Qualitative Effects We often want to test whether being in some category (such as gender, hukou, race, region, etc.) has any effect on dependent variables, controlling for other factors. With multiple linear regression with binary variables, we may easily achieve this. For example, to test whether or not females are discriminated in work places, we may run log(income) = β 0 + β 1 edu + β 2 expr + β 3 female + u, and test H 0 : β 3 = 0 H 1 : β 3 < 0.

Modeling Binary Choices Decision to migrate or not Buy a car or not Rent or buy an apartment To vote for or against a bill For college/mba graduates, find a job within 3 months For females, to be a housewife or not.

Binary Distribution Let y be the binary choice variable taking values of 0 and 1. We can describe y by binary (or Bernoulli) distribution with parameter p, { p if y = 1 f (y) = 1 p if y = 0 Equivalently, we may write We have f (y) = p y (1 p) 1 y, y = 0, 1. Ey = p var(y) = p(1 p).

Linear Probability Model Let x be a vector of variables that influences the outcome of y, which takes value of 0 or 1. We may write a linear probability model as follows, y = x β + u. Let p = E(y x) = x β. It is the probability of y = 1 given x. Conditional on x, y is distributed as Binary(p). var(y x) is then p(1 p) = x β(1 x β).

An Example Suppose y denotes the decision of an individual on whether or not migrates to city. And let x be the income the individual receives from previous job in the countryside. We may construct a simple migration model, y = β 0 + β 1 x + u.

Problem of Linear Probability Model Heteroscedasticity. Nonsense Probability To see this, observe that after estimation, ŷ = ˆp = x ˆβ. To make predictions based on the estimated model, it is not guaranteed that ˆp [0, 1]. The nonsense probability comes from linear marginal probability, p x = β.

Probit and Logit Model One method to limit p within [0, 1] is to use the cumulative distribution function (cdf) of a distribution, say F ( ), p = F (x β) = P(Z x β). If F is the cdf of the standard normal distribution (N(0,1)), then the model is called a probit model. If F (s) = 1 1+e s, then the model is called a logit model. Note that in this case, F is the cdf of a logistic distribution.

Marginal Effects on Probability Probit and logit models are nonlinear models with nonlinear marginal effects on probability, p x = f (x β)β, (1) where f is the pdf of the corresponding distribution. When x β is large, the marginal probability is small. When x β = 0, f reaches maximum and the marginal effects on probability would be the largest. If x contains a binary variable d, the marginal probability is given by P(y = 1 x (d), d = 1) P(y = 1 x (d), d = 0). where x (d) contains all other variables. However, the formula in (1) is often accurate enough for binary variables too.

Estimation of Probit and Logit Models We have to estimate the probit and logit models using MLE. The likelihood function is given by where p(β Y, X ) = n p i (β x i ) y i (1 p i (β x i )) 1 y i, i=1 p i (β x i ) = F (x i β). The log likelihood function is given by l(β Y, X ) = n { yi log F (x i β) i=1 + (1 y i ) log(1 F (x i β)) }. The MLE estimator solves the following maximization problem, max l(β Y, X ). β

Generalized Linear Model The GLM generalizes a large class of statistical models, including the classical linear regression and the logit/probit model. In a GLM, the dependent variables y is assumed to be generated from a particular distribution in the exponential family, which includes the normal, binomial, Poisson and gamma distributions, among others. The mean of the distribution depends on the independent variables x through: E(y x) = µ = g 1 (x β), where g( ) is a link function that links the linear predictor η = x β with µ, η = g(µ). Linear regression: y is normal, µ = x β, g is identity. Logit/probit model: y is binary, µ = F (x β), g = F 1. Poisson regression: y is Poisson, µ = exp(x β), g = log.