Empirical Methods for Microeconomic Applications William Greene Department of Economics Stern School of Business
Upload Your Project File
Probit Model Command Load healthcare.lpj Command Builder Text Editor
Command Builder Go button in command builder
Partial Effects for Interactions
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)20 ; Plot(ci) $
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 .00441 .00059 7.47 .00325 .00557 EDUC = 8.00 .00485 .00101 4.80 .00287 .00683 EDUC = 10.00 .00463 .00068 6.80 .00329 .00596 EDUC = 12.00 .00439 .00061 7.18 .00319 .00558 EDUC = 14.00 .00412 .00091 4.53 .00234 .00591 EDUC = 16.00 .00384 .00138 2.78 .00113 .00655 EDUC = 18.00 .00354 .00192 1.84 -.00023 .00731 EDUC = 20.00 .00322 .00250 1.29 -.00168 .00813
Useful Plot
More Elaborate Partial Effects PROBIT ; Lhs = Doctor ; Rhs = one,age,educ,age^2,age*educ, female,female*educ,income $ PARTIAL ; Effects: income @ female = 0,1 ? Do for each subsample | educ = 12,16,20 ? Set 3 fixed values & age = 20(10)50 ? APE for each setting
Constructed Partial Effects
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 ; 1-100 $ PROBIT ; Lhs=doctor ; Rhs=… ; List ; Prob=Pfit $ DSTAT ; Rhs = Doctor,PFIT $
Lab Session 2 Ordered Choice Models
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
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.
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.
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
Sample Selection in Ordered Choice
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.
Zero Inflated Ordered Probit
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.
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..
Lab Session 2 Models for Counts
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
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) $
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)
Robust Covariance Matrix “Robust” sandwich estimator is appropriate for the Poisson and other loglinear models POISSON ; … ; ROBUST $
“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.
Exposure Variable
Sample Selection
Estimating a Selection Model ? Selection Equation Probit ; Lhs = … ; Rhs = … ; Hold $ ? Main Regression Equation Poisson ; Lhs = … ; Rhs = … ; Selection $
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
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
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
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
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 $
Poisson and NB with Normal Heterogeneity
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
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
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