Panel GLMs Department of Political Science and Government Aarhus - - PowerPoint PPT Presentation

panel glms
SMART_READER_LITE
LIVE PREVIEW

Panel GLMs Department of Political Science and Government Aarhus - - PowerPoint PPT Presentation

Review of Panel Data Model Types Next Steps Panel GLMs Department of Political Science and Government Aarhus University May 12, 2015 Review of Panel Data Model Types Next Steps 1 Review of Panel Data 2 Model Types 3 Review and Looking


slide-1
SLIDE 1

Review of Panel Data Model Types Next Steps

Panel GLMs

Department of Political Science and Government Aarhus University

May 12, 2015

slide-2
SLIDE 2

Review of Panel Data Model Types Next Steps

1 Review of Panel Data 2 Model Types 3 Review and Looking Forward

slide-3
SLIDE 3

Review of Panel Data Model Types Next Steps

1 Review of Panel Data 2 Model Types 3 Review and Looking Forward

slide-4
SLIDE 4

Review of Panel Data Model Types Next Steps

Segue From Event-History

Event history analysis involves the analysis of durations and probabilities of state changes

  • ver time across many units

Each unit’s trajectory or history can begin at an arbitrary point in time

  • Ex. 1: Colony’s time to independence after 1900
  • Ex. 2: Durability of democratic government after

independence

In problems (like Ex. 1), we are interested in studying units over the same period of time

slide-5
SLIDE 5

Review of Panel Data Model Types Next Steps

Panel Analysis

In event history analysis, time is our key variable In panel analysis:

unit characteristics are our key variables

  • bservations exist simultaneously

We are interested in effects of X on Y

slide-6
SLIDE 6

Review of Panel Data Model Types Next Steps

Terminology

slide-7
SLIDE 7

Review of Panel Data Model Types Next Steps

Terminology

Panel

slide-8
SLIDE 8

Review of Panel Data Model Types Next Steps

Terminology

Panel Wide versus Long data

slide-9
SLIDE 9

Review of Panel Data Model Types Next Steps

Terminology

Panel Wide versus Long data Time-varying versus time-invariant

slide-10
SLIDE 10

Review of Panel Data Model Types Next Steps

Terminology

Panel Wide versus Long data Time-varying versus time-invariant Balanced versus Unbalanced panel

slide-11
SLIDE 11

Review of Panel Data Model Types Next Steps

Terminology

Panel Wide versus Long data Time-varying versus time-invariant Balanced versus Unbalanced panel Fixed effects

slide-12
SLIDE 12

Review of Panel Data Model Types Next Steps

Terminology

Panel Wide versus Long data Time-varying versus time-invariant Balanced versus Unbalanced panel Fixed effects Random effects

slide-13
SLIDE 13

Review of Panel Data Model Types Next Steps

Panel versus Time-Series

Cross-sectional data involve many units

  • bserved at one time

Panel data involve many units over at multiple points in time Time-series data involve one (or more) units

  • bserved at multiple points time

Time-Series, Cross-Sectional (TSCS) data are panel data

Sometimes the units are aggregations

Within-subjects analysis is panel analysis

slide-14
SLIDE 14

Review of Panel Data Model Types Next Steps

Causal Inference

What is the goal of causal inference? How do we define a causal effect (in terms of counterfactuals)?

slide-15
SLIDE 15

Review of Panel Data Model Types Next Steps

Causal Inference

What is the goal of causal inference? How do we define a causal effect (in terms of counterfactuals)? If Xi is time-varying, we observe Yi for the same unit i when Xi takes on different values

slide-16
SLIDE 16

Review of Panel Data Model Types Next Steps

Causal Inference

What is the goal of causal inference? How do we define a causal effect (in terms of counterfactuals)? If Xi is time-varying, we observe Yi for the same unit i when Xi takes on different values Is this the same as observing both Y0it and Y1it?

slide-17
SLIDE 17

Review of Panel Data Model Types Next Steps

Causal Inference

What is the goal of causal inference? How do we define a causal effect (in terms of counterfactuals)? If Xi is time-varying, we observe Yi for the same unit i when Xi takes on different values Is this the same as observing both Y0it and Y1it? Then why are panel data useful?

slide-18
SLIDE 18

Review of Panel Data Model Types Next Steps

1 Review of Panel Data 2 Model Types 3 Review and Looking Forward

slide-19
SLIDE 19

Review of Panel Data Model Types Next Steps

Nonlinear Panel Models Examples

slide-20
SLIDE 20

Review of Panel Data Model Types Next Steps

Nonlinear Panel Models Examples

Binary outcome

slide-21
SLIDE 21

Review of Panel Data Model Types Next Steps

Nonlinear Panel Models Examples

Binary outcome Ordered outcome

slide-22
SLIDE 22

Review of Panel Data Model Types Next Steps

Nonlinear Panel Models Examples

Binary outcome Ordered outcome Count outcome

slide-23
SLIDE 23

Review of Panel Data Model Types Next Steps

Nonlinear Panel Models Examples

Binary outcome Ordered outcome Count outcome Multinomial outcome

slide-24
SLIDE 24

Review of Panel Data Model Types Next Steps

Nonlinear Panel Models Examples

Binary outcome Ordered outcome Count outcome Multinomial outcome Censored

slide-25
SLIDE 25

Review of Panel Data Model Types Next Steps

Research Questions

Form groups of 4 Generate a research question involving:

Binary outcome Ordered outcome Count outcome

For each type, generate an institutional- and an individual-level question So 6 research questions total

slide-26
SLIDE 26

Review of Panel Data Model Types Next Steps

Review: Basic Panel Approaches

Pooled estimator Fixed effects estimator Random effects estimator

slide-27
SLIDE 27

Review of Panel Data Model Types Next Steps

Review: Basic Panel Approaches

Pooled estimator Fixed effects estimator Random effects estimator We’ll focus on binary models first

slide-28
SLIDE 28

Review of Panel Data Model Types Next Steps

Estimation Issues

Cross-sectional OLS models are easy to estimate Linear panel models are fairly easy to estimate

slide-29
SLIDE 29

Review of Panel Data Model Types Next Steps

Estimation Issues

Cross-sectional OLS models are easy to estimate Linear panel models are fairly easy to estimate Cross-sectional GLMs are modestly hard to estimate

No closed-form solution Often rely on maximization algorithms

slide-30
SLIDE 30

Review of Panel Data Model Types Next Steps

Estimation Issues

Cross-sectional OLS models are easy to estimate Linear panel models are fairly easy to estimate Cross-sectional GLMs are modestly hard to estimate

No closed-form solution Often rely on maximization algorithms

Nonlinear panel models are harder to estimate

slide-31
SLIDE 31

Review of Panel Data Model Types Next Steps

Who cares?

If Stata can give us numbers, who cares what’s happening? More difficult problem means greater diversity

  • f solutions

No obvious best solution Terminology overload Assumptions!

slide-32
SLIDE 32

Review of Panel Data Model Types Next Steps

Who cares?

If Stata can give us numbers, who cares what’s happening? More difficult problem means greater diversity

  • f solutions

No obvious best solution Terminology overload Assumptions!

Be cautious when treading into unfamiliar waters!

slide-33
SLIDE 33

Review of Panel Data Model Types Next Steps

Terms You Might See

Quadrature Conditional Likelihood Simulated Likelihood Generalized Estimating Equation (GEE) Generalized Method of Moments (GMM)

slide-34
SLIDE 34

Review of Panel Data Model Types Next Steps

Pooled Estimator

yit = β0 + β1xit + · · · + ǫit Ignores panel structure (interdependence) Ignores heterogeneity between units But, we can actually easily estimate and interpret this model! Estimation uses “generalized estimating equations” (GEE) Note: Also called population-averaged model

slide-35
SLIDE 35

Review of Panel Data Model Types Next Steps

Pooled Estimator

Continuous outcomes: yit = β0 + β1xit + · · · + ǫit Binary outcomes: yit∗ = β0 + β1xit + · · · + ǫit yit = 1 if yit∗ > 0, and 0 otherwise Link functions are the same in panel as in cross-sectional

Logit Probit

Use clustered standard errors

slide-36
SLIDE 36

Review of Panel Data Model Types Next Steps

Respecting the Panel Structure

With a panel structure, ǫit can be decomposed into two parts:

υit ui

If we assume ui is unrelated to X: fixed effects If we allow a correlation: random effects

slide-37
SLIDE 37

Review of Panel Data Model Types Next Steps

Fixed Effects Estimator

This gives us: yit = β0 + β1xit + · · · + υit + ui yit = β0idit + β1xit + · · · + υit (1) Varying intercepts (one for each unit) Can generalize to other specifications (e.g., fixed period effects)

slide-38
SLIDE 38

Review of Panel Data Model Types Next Steps

Fixed Effects Estimator

Fixed effects terms absorb all time-invariant between-unit heterogeneity Effects of time-invariant variables cannot be estimated Each unit is its own control (“within” estimation) Two ways to estimate this:

Unconditional maximum likelihood Conditional maximum likelihood

Both are problematic

slide-39
SLIDE 39

Review of Panel Data Model Types Next Steps

Fixed Effects Estimator

Unconditional maximum likelihood

From OLS: dummy variables for each unit Number of parameters to estimate increases with sample size For logit/probit: incidental parameters problem Estimate become inconsistent

Conditional maximum likelihood

From OLS: “De-meaned” data to avoid estimating unit-specific intercepts For logit: condition on Pr(Yi = 1) across all t periods Does not work for probit!

slide-40
SLIDE 40

Review of Panel Data Model Types Next Steps

Conditional MLE

Estimates only based on units that change in Y Effects of time-invariant variables are not estimable Observations with time-invariant outcome are dropped

slide-41
SLIDE 41

Review of Panel Data Model Types Next Steps

Conditional MLE

Estimates only based on units that change in Y Effects of time-invariant variables are not estimable Observations with time-invariant outcome are dropped Estimation of two-wave panel using fixed-effects logistic regression is same as a pooled logistic regression where the outcome is direction of change regressed on time-differenced explanatory variables

slide-42
SLIDE 42

Review of Panel Data Model Types Next Steps

Fixed Effects Estimator

Interpretation is difficult Use predict to get fitted values on the latent scale margins, dydx() is also problematic

Use , predict(xb) to obtain log-odds marginal effects Use , predict(pu0) to assume fixed effect is zero Neither of those is the default

slide-43
SLIDE 43

Review of Panel Data Model Types Next Steps

Questions?

slide-44
SLIDE 44

Review of Panel Data Model Types Next Steps

Random Effects Estimator

If we are willing to assume that unit-specific error term is uncorrelated with other variables Why might this not be the case?

slide-45
SLIDE 45

Review of Panel Data Model Types Next Steps

Random Effects Estimator

If we are willing to assume that unit-specific error term is uncorrelated with other variables Why might this not be the case? Pooled estimator also makes this assumption But that estimator ignores panel structure (non-independence)

slide-46
SLIDE 46

Review of Panel Data Model Types Next Steps

Estimation hell!

slide-47
SLIDE 47

Review of Panel Data Model Types Next Steps

Estimation hell!

Due to incidental parameters problem we cannot consistently estimate both the regression coefficients and the unit-specific effects

slide-48
SLIDE 48

Review of Panel Data Model Types Next Steps

Estimation hell!

Due to incidental parameters problem we cannot consistently estimate both the regression coefficients and the unit-specific effects We have to make some assumptions about the unit-specific error terms But assumptions get us to a likelihood function that can only be maximized via integration of a complicated function Quadrature (a form of numerical approximation

  • f an integral) is therefore used (costly!)
slide-49
SLIDE 49

Review of Panel Data Model Types Next Steps

Random Effects Estimator

Can be used with logit or probit Interpretation is messy because unit-specific error terms are unobserved Thus marginal effects calculation must make an assumption of about the random effects:

Predict log-odds: margins, dydx(*) Assume they are 0: , predict(pu0)

slide-50
SLIDE 50

Review of Panel Data Model Types Next Steps

Random versus Fixed Effects

Different assumptions Very different estimation strategies

These are consequential for interpretation

Use Hausman test to decide between estimators:

xtlogit ..., fe estimates store fixed xtlogit ..., re estimates store random hausman fixed random

Use FE if H0 rejected

slide-51
SLIDE 51

Review of Panel Data Model Types Next Steps

Reminder!

Some outcomes are binary but are constant before and after an “event”

Individual graduates from university Country transitions to democracy

We can analyze these using binary outcome panel models or using event-history methods from last week Either might be appropriate, depending on the research question, hypothesis, and data

slide-52
SLIDE 52

Review of Panel Data Model Types Next Steps

Questions about Binary Models?

slide-53
SLIDE 53

Review of Panel Data Model Types Next Steps

Example: Wawro

Form groups of three Discuss:

What is the research question? What is the method used? What are the results?

slide-54
SLIDE 54

Review of Panel Data Model Types Next Steps

Ordered Outcome Models

Estimators exist, but only random effects is implemented in Stata

Logit and probit available

Other possible analysis strategies:

Use a linear panel specification (xtreg) Estimate a pooled model (ologit/oprobit) with clustered SEs Recode categories to binary and use xtlogit Use a mixed effects specification (meologit/meoprobit)

slide-55
SLIDE 55

Review of Panel Data Model Types Next Steps

Count Outcome Models

Count outcome models are somewhat easier to estimate than binary outcome models Still have pooled, fixed effects, and random effects strategies As in cross-sectional data, prefer negative binomial regression over Poisson regression when there is overdispersion Methods using unconditional maximum likelihood (fixed effects) are computationally expensive

slide-56
SLIDE 56

Review of Panel Data Model Types Next Steps

Interpreting Count Models

Predict the linear/latent scale: margins, predict(xb) Predict outcomes, assuming fixed/random effect is zero: margins, predict(nu0) With RE, assuming random effect is zero: margins, predict(pr0(n )), where n is number of events

slide-57
SLIDE 57

Review of Panel Data Model Types Next Steps

Interpreting Count Models

Coefficients can be translated into incidence rate ratios using , irr option in Stata This is sort of like the odds-ratio interpretation for binary outcome models Meaning: a unit change in x produces a change in the incidence rate for the outcome

If IRR > 1: unit change in x increases rate of y If IRR < 1: unit change in x decreases rate of y

May be helpful, may not. You can choose for yourself.

slide-58
SLIDE 58

Review of Panel Data Model Types Next Steps

Example: Seeberg

Form groups of three Discuss:

What is the research question? What is the method used? What are the results?

slide-59
SLIDE 59

Review of Panel Data Model Types Next Steps

Questions about Count Models?

slide-60
SLIDE 60

Review of Panel Data Model Types Next Steps

Standard Errors

Standard errors can be complicated For pooled model, use standard errors clustered by unit

vce(robust) vce(cluster id)

For random effects, you may want bootstrapped standard errors Always check for robustness

slide-61
SLIDE 61

Review of Panel Data Model Types Next Steps

Interpretation: Quick Review

Usual rules don’t apply Estimation via an MLE variant usually means marginal effects are undefined Depending on model specification, predicted values may also be conditional We have to make further assumptions to create an interpretable quantity of interest from the model

slide-62
SLIDE 62

Review of Panel Data Model Types Next Steps

Intepretation: Trade-offs

Analytic trade-off between model choice and interpretability Pooled estimates are interpretable in conventional ways, but use assumptions

Ignores panel structure No unobserved confounding/heterogeneity

Other models are harder to estimate and interpret, but may be more “correct,” though:

RE assumes heterogeneity is not confounding FE disallows effects of time-invariant variables

slide-63
SLIDE 63

Review of Panel Data Model Types Next Steps

Mixed Effects

We can also estimate mixed effects models for non-linear outcomes This works more or less as with linear outcomes

Binary: melogit, meprobit Ordered: meologit, meoprobit Count: mepoisson, menbreg Linear: mixed

Estimation and interpretation is similar to hierarchical linear models

slide-64
SLIDE 64

Review of Panel Data Model Types Next Steps

Questions about anything?

slide-65
SLIDE 65

Review of Panel Data Model Types Next Steps

1 Review of Panel Data 2 Model Types 3 Review and Looking Forward

slide-66
SLIDE 66

Review of Panel Data Model Types Next Steps

Where have we been?

What have we learned in this course? What haven’t we learned in this course?

slide-67
SLIDE 67

Review of Panel Data Model Types Next Steps

What have we learned?

slide-68
SLIDE 68

Review of Panel Data Model Types Next Steps

What have we learned?

Thinking about causality as counterfactuals

slide-69
SLIDE 69

Review of Panel Data Model Types Next Steps

What have we learned?

Thinking about causality as counterfactuals How to obtain causal inference from

  • bservational data
slide-70
SLIDE 70

Review of Panel Data Model Types Next Steps

What have we learned?

Thinking about causality as counterfactuals How to obtain causal inference from

  • bservational data

Analyzing continuous outcome data

slide-71
SLIDE 71

Review of Panel Data Model Types Next Steps

What have we learned?

Thinking about causality as counterfactuals How to obtain causal inference from

  • bservational data

Analyzing continuous outcome data Analyzing binary, ordered, and count outcome data

slide-72
SLIDE 72

Review of Panel Data Model Types Next Steps

What have we learned?

Thinking about causality as counterfactuals How to obtain causal inference from

  • bservational data

Analyzing continuous outcome data Analyzing binary, ordered, and count outcome data Analyzing event histories

slide-73
SLIDE 73

Review of Panel Data Model Types Next Steps

What have we learned?

Thinking about causality as counterfactuals How to obtain causal inference from

  • bservational data

Analyzing continuous outcome data Analyzing binary, ordered, and count outcome data Analyzing event histories Analyzing data over time

slide-74
SLIDE 74

Review of Panel Data Model Types Next Steps

What have we learned?

Thinking about causality as counterfactuals How to obtain causal inference from

  • bservational data

Analyzing continuous outcome data Analyzing binary, ordered, and count outcome data Analyzing event histories Analyzing data over time Managing complex data structures

slide-75
SLIDE 75

Review of Panel Data Model Types Next Steps

What have we learned?

Thinking about causality as counterfactuals How to obtain causal inference from

  • bservational data

Analyzing continuous outcome data Analyzing binary, ordered, and count outcome data Analyzing event histories Analyzing data over time Managing complex data structures Data interpretation!

slide-76
SLIDE 76

Review of Panel Data Model Types Next Steps

What should I learn next?

slide-77
SLIDE 77

Review of Panel Data Model Types Next Steps

What should I learn next?

Measurement: factor analysis, principal components, IRT

slide-78
SLIDE 78

Review of Panel Data Model Types Next Steps

What should I learn next?

Measurement: factor analysis, principal components, IRT Design: surveys, experiments, data gathering

slide-79
SLIDE 79

Review of Panel Data Model Types Next Steps

What should I learn next?

Measurement: factor analysis, principal components, IRT Design: surveys, experiments, data gathering Classification: regression trees, classifiers, SVM

slide-80
SLIDE 80

Review of Panel Data Model Types Next Steps

What should I learn next?

Measurement: factor analysis, principal components, IRT Design: surveys, experiments, data gathering Classification: regression trees, classifiers, SVM Clustering: K-means, hierarchical clustering

slide-81
SLIDE 81

Review of Panel Data Model Types Next Steps

What should I learn next?

Measurement: factor analysis, principal components, IRT Design: surveys, experiments, data gathering Classification: regression trees, classifiers, SVM Clustering: K-means, hierarchical clustering Nonparametric statistics

slide-82
SLIDE 82

Review of Panel Data Model Types Next Steps

What should I learn next?

Measurement: factor analysis, principal components, IRT Design: surveys, experiments, data gathering Classification: regression trees, classifiers, SVM Clustering: K-means, hierarchical clustering Nonparametric statistics Bayesian statistics

slide-83
SLIDE 83

Review of Panel Data Model Types Next Steps

What should I learn next?

Measurement: factor analysis, principal components, IRT Design: surveys, experiments, data gathering Classification: regression trees, classifiers, SVM Clustering: K-means, hierarchical clustering Nonparametric statistics Bayesian statistics Time series analysis

slide-84
SLIDE 84

Review of Panel Data Model Types Next Steps

What should I learn next?

Measurement: factor analysis, principal components, IRT Design: surveys, experiments, data gathering Classification: regression trees, classifiers, SVM Clustering: K-means, hierarchical clustering Nonparametric statistics Bayesian statistics Time series analysis Data visualization

slide-85
SLIDE 85

Review of Panel Data Model Types Next Steps

What should I learn next?

Measurement: factor analysis, principal components, IRT Design: surveys, experiments, data gathering Classification: regression trees, classifiers, SVM Clustering: K-means, hierarchical clustering Nonparametric statistics Bayesian statistics Time series analysis Data visualization “Big data”

slide-86
SLIDE 86

Review of Panel Data Model Types Next Steps

Goals for this course

slide-87
SLIDE 87

Review of Panel Data Model Types Next Steps

Goals for this course

Describe politically relevant research questions and hypotheses

slide-88
SLIDE 88

Review of Panel Data Model Types Next Steps

Goals for this course

Describe politically relevant research questions and hypotheses Evaluate and deduce observable implications from political science theories

slide-89
SLIDE 89

Review of Panel Data Model Types Next Steps

Goals for this course

Describe politically relevant research questions and hypotheses Evaluate and deduce observable implications from political science theories Explain statistical procedures and their appropriate usages

slide-90
SLIDE 90

Review of Panel Data Model Types Next Steps

Goals for this course

Describe politically relevant research questions and hypotheses Evaluate and deduce observable implications from political science theories Explain statistical procedures and their appropriate usages Apply statistical procedures to relevant research problems

slide-91
SLIDE 91

Review of Panel Data Model Types Next Steps

Goals for this course

Describe politically relevant research questions and hypotheses Evaluate and deduce observable implications from political science theories Explain statistical procedures and their appropriate usages Apply statistical procedures to relevant research problems Synthesize results from statistical analyses into well-written and well-structured essays

slide-92
SLIDE 92

Review of Panel Data Model Types Next Steps

Goals for this course

Describe politically relevant research questions and hypotheses Evaluate and deduce observable implications from political science theories Explain statistical procedures and their appropriate usages Apply statistical procedures to relevant research problems Synthesize results from statistical analyses into well-written and well-structured essays Demonstrate how to use Stata for statistical analysis

slide-93
SLIDE 93

Review of Panel Data Model Types Next Steps

Exam

Standard 7-day home assignment We will give you a question and data You write an essay that answers that question To do well:

Understand your analysis Justify your analysis Interpret your analysis

Exam allows for considerable flexibility

slide-94
SLIDE 94

Review of Panel Data Model Types Next Steps

Questions?

slide-95
SLIDE 95

Review of Panel Data Model Types Next Steps

Course Evaluations

What went well in this course? What would you like to have gone differently?

slide-96
SLIDE 96

Review of Panel Data Model Types Next Steps

Course Evaluations

What went well in this course? What would you like to have gone differently? http://www.survey-xact.dk/ LinkCollector?key=YAV25A9Q359N

slide-97
SLIDE 97

Review of Panel Data Model Types Next Steps

Preview

Tomorrow: More panel GLMs in Stata Next week:

Optional Q/A Session (14:15–15:00) In this room Readings test your knowledge on complex articles

PhD Students: meet here next week at 15:00

slide-98
SLIDE 98