Download presentation
Presentation is loading. Please wait.
Published byMarlene Johns Modified over 5 years ago
1
Empirical Methods for Microeconomic Applications
William Greene Department of Economics Stern School of Business
2
Upload Your Project File
3
Probit Model Command Load healthcare.lpj Command Builder Text Editor
4
Command Builder Go button in command builder
8
Partial Effects for Interactions
9
Partial Effects Build the interactions into the model statement
PROBIT ; Lhs = Doctor ; Rhs = one,age,educ,age^2,age*educ $ Built in computation for partial effects PARTIALS ; Effects: Age & Educ = 8(2) ; Plot(ci) $
10
Average Partial Effects
Partial Effects Analysis for Probit Probability Function Partial effects on function with respect to AGE Partial effects are computed by average over sample observations Partial effects for continuous variable by differentiation Partial effect is computed as derivative = df(.)/dx df/dAGE Partial Standard (Delta method) Effect Error |t| 95% Confidence Interval Partial effect EDUC = EDUC = EDUC = EDUC = EDUC = EDUC = EDUC =
11
Useful Plot
12
More Elaborate Partial Effects
PROBIT ; Lhs = Doctor ; Rhs = one,age,educ,age^2,age*educ, female,female*educ,income $ PARTIAL ; Effects: income @ female = 0, ? Do for each subsample | educ = 12,16,20 ? Set 3 fixed values & age = 20(10)50 ? APE for each setting
13
Constructed Partial Effects
14
PROBIT ; Lhs=doctor ; Rhs=… ; List ; Prob=Pfit $
Predictions List and keep predictions Add ; List ; Prob = PFIT to the probit or logit command (Tip: Do not use ;LIST with large samples!) Sample ; $ PROBIT ; Lhs=doctor ; Rhs=… ; List ; Prob=Pfit $ DSTAT ; Rhs = Doctor,PFIT $
15
Lab Session 2 Ordered Choice Models
16
Data Set healthcare.lpj Data for this session are
Refer to healthcare.lim for full list of the variables. This is an unbalanced panel. The group counter is already in the data set. Use ;PDS=_Groupti for panel models
17
Binary Dependent Variables
DOCTOR = visited the doctor at least once HOSPITAL = went to the hospital at least once. PUBLIC = has public health insurance (1=YES) ADDON = additional health insurance.(1=Yes) ADDON is extremely unbalanced.
18
Dependent Variables: Ordered
HSAT = ordered reported health satisfaction, coded 0,1,…,10. Use with ORDERED or ORDERED ; Logit Request marginal effects with ; Marginal as usual.
19
Ordered Choice Models Ordered ; Lhs = dependent variable
; Rhs = One, … independent variables $ Remember to include the constant term For ordered logit in stead of ordered probit, use Ordered ; Logit ; Lhs = dependent variable To get marginal effects, use ; Margin as usual. There are fixed and random effects estimators for this model: ; FEM ; PDS = _Groupti ; Random ; PDS = _Groupti
20
Sample Selection in Ordered Choice
21
Sample Selection Ordered Probit
PROBIT ; Lhs = … ; Rhs = … ; HOLD $ ORDERED ; Lhs = … ; Rhs = … ; Selection $ This is a maximum likelihood estimator, not a least squares estimator. There is no ‘lambda’ variable. The various parameters are present in the likelihood function.
22
Zero Inflated Ordered Probit
23
Zero Inflated Ordered Probit Model
Zero inflated ordered probit model with correlation: A probit model for the zero cell (E.g., You can use DOCTOR for a model.) Create ; y1 = y > 0 $ Probit ; … ; HOLD $ Ordered probit with excess zeros Orde ; Lhs … ; Rhs … ; ZIOP$ Correlation between w (in probit) and ε in ordered probit model ; CORRELATION is optional. Rho=0 is the default.
24
Hierarchical Ordered Probit
Hierarchical ordered probit. Ordered probit in which threshold parameters depend on variables. Two forms: HO1: μ(i,j) = exp[θ(j) + δ’z(i)]. HO2, different δ vector for each j. Use ORDERED ; … ; HO1 = list of variables or ORDERED ; … ; HO2 = list of variables. Can combine with SELECTION models and zero inflation models. This is also the Pudney and Shields generalized ordered probit from Journal of Applied Econometrics, August 2000, with the modification of using exp(…) and internally, a way to make sure that the thresholds are ordered..
25
Lab Session 2 Models for Counts
26
Data Set healthcare.lpj Data for this session are
Refer to healthcare.lim for full list of the variables. This is an unbalanced panel. The group counter is already in the data set. Use ;PDS=_Groupti for panel models
27
Dependent Variables: Count
DOCVIS = count of visits to the doctor HOSPVIS = count of visits to the hospital. There are outliers. It helps to use truncated or censored samples (1) Truncated Data SAMPLE ; All $ REJECT ; DocVis > 10 $ before using or REJECT ; HospVis > 10 $ before using. Then, if using a panel data estimator, use REGRESS ; Lhs = One ; Rhs = One ; Str = ID ; Panel $ to create the _GROUPTI count variable (2) Censored Data CREATE ; DocVis10 = Min(10,DocVis) ; Hosp10 = Min(10,HospVis) $
28
Models for Count Data Basic models Poisson and negative binomial
POISSON ; Lhs = y ; Rhs = One,… $ NEGBIN ; Lhs = y ; Rhs = One,… $ Many extensions Various heterogeneity forms Panel data Random parameters and latent class Zero inflation Sample selection Censoring and truncation Numerous others… (some, far from all, shown below)
29
Robust Covariance Matrix
“Robust” sandwich estimator is appropriate for the Poisson and other loglinear models POISSON ; … ; ROBUST $
30
“Offset” Variables Poisson (and NB) mean is a rate per unit of time.
In the sample, all observations should be observed (exposed) for the same length of time. Else, the appropriate model is as shown below.
31
Exposure Variable
32
Sample Selection
33
Estimating a Selection Model
? Selection Equation Probit ; Lhs = … ; Rhs = … ; Hold $ ? Main Regression Equation Poisson ; Lhs = … ; Rhs = … ; Selection $
34
NegBin with Heterogeneity in Alpha
In the negative binomial model, the overdispersion parameter is α, with the model assumption λ = exp(β’x) E[y|x] = λ Var[y|x] = λ[1+ α λ] We allow α to be heterogeneous: α = exp(δ’z) Use ; Hfn = … variables in z
35
Censoring and Truncation
Censoring limit C Right (upper): Values larger than C are set to Ci. The largest value in the sample is C. Use ;LIMIT=C;MAXIMUM Left (lower): Values less than C are set equal to C. The smallest value in the sample is C. Use ;LIMIT=C Truncation limit C Right (upper): Values greater than or equal to C have been discarded. The largest value in the sample is C-1. Use ;LIMIT=C;TRUNCATION;UPPER Left (lower): Values less than or equal to C have been discarded. The smallest value in the sample is C+1. Use ;LIMIT=C;TRUNCATION
36
Zero Inflation Two regime, latent class model Reduced form:
Prob[Regime 1 => y=0] = q Prob[y = j|Regime 2] = Poisson or NegBin, λ=exp(β’x) Reduced form: Prob[y=0] = q + (1-q)P(0) Prob[y=j > 0] = (1-q)P(j) Regime Models: q = Probit or Logit Structures: ZIP: Probit or Logit F(γ’z) z can be any set of variables ZIP-tau: Probit or Logit F(τ β’x) – same β’x as above
37
ZIP and ZIP-tau Models ;ZIP Logit, ZIP-tau
;ZIP = Normal: Probit ZIP-tau ;ZIP [=Normal] ; Rh2 = variables in z Alternative Models Default is Poisson ;MODEL = NegBin ;MODEL = Gamma
38
Hurdle Model Two Part Model:
Prob[y=0] = Logit or Probit using β’x from the count model or γ’z as specified with ;RH2=list Prob[y=j|j>0] = Truncated Poisson or NegBin Two part decision: Drug or alcohol use, for example POISSON ; … ; Hurdle $ POISSON ; … ; Hurdle ; Rh2 = List $
39
Poisson and NB with Normal Heterogeneity
40
Fixed and Random Effects
Poisson or NegBin ;PDS=setting Fixed Effects Default is a conditional esitmator ;FEM uses the unconditional estimator The two are algebraically identical but use different algorithms Random Effects Use ; RANDOM Can be fit as a random parameters model with just a random constant
41
Random Parameters Poisson ; LHS = dependent variable
; RHS = independent variable(s) ; PDS = setting (may be ;PDS=1) ; RPM ; PTS = number of Points ; Halton (for smarter integration method) ; Correlated if desired to fit correlated parameters model ; FCN = variable(n) , variable(n), … to indicate which parameters are random
42
Latent Class Poisson (or NEGBIN) ; LHS = dependent variable
; RHS = independent variable(s) ; LCM for a latent class model ; LCM = variables if probabilities are heterogeneous ; PDS = setting (may be ;PDS=1) ; PTS = number of latent classes
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.