Chapter 2 Panel Data Models with Oneway Effects





































- Slides: 37
Chapter 2: Panel Data Models with One-way Effects This chapter introduces panel data models with unobservable individual-specific effects, or one-way effects. We will discuss: inference methods for fixed effects panel data models; inference methods for random effects panel data models; an important issue on fixed effects vs random effects, and methods for choosing an appropriate model; prediction based on panel data model. Finally, several empirical examples will be presented using STATA, to illustrate various penal data methods introduced. zlyang@smu. edu. sg http: //www. mysmu. edu/faculty/zlyang/ Zhenlin Yang
2. 1. Introduction ECON 6002, Term II 2020 -21 2 Chapter 2 © Zhenlin Yang, SMU
Fixed and Random Effects Chapter 2 v ECON 6002, Term II 2020 -21 3 © Zhenlin Yang, SMU
2. 2. One-way fixed effects model Chapter 2 v ECON 6002, Term II 2020 -21 4 © Zhenlin Yang, SMU
Least squares dummy variable estimation ECON 6002, Term II 2020 -21 5 Chapter 2 © Zhenlin Yang, SMU
Least squares dummy variable estimation ECON 6002, Term II 2020 -21 6 Chapter 2 © Zhenlin Yang, SMU
Least squares dummy variable estimation ECON 6002, Term II 2020 -21 7 Chapter 2 © Zhenlin Yang, SMU
Least squares dummy variable estimation ECON 6002, Term II 2020 -21 8 Chapter 2 © Zhenlin Yang, SMU
Within group estimation Chapter 2 Thus, P is matrix which averages the observations across time for each individual. ECON 6002, Term II 2020 -21 9 © Zhenlin Yang, SMU
Within group estimation ECON 6002, Term II 2020 -21 10 Chapter 2 © Zhenlin Yang, SMU
Testing for fixed effects Chapter 2 v See Ch. 4 for more on testing. ECON 6002, Term II 2020 -21 11 © Zhenlin Yang, SMU
Robust estimates of standard errors Chapter 2 v ECON 6002, Term II 2020 -21 12 © Zhenlin Yang, SMU
Robust estimates of standard errors ECON 6002, Term II 2020 -21 13 Chapter 2 © Zhenlin Yang, SMU
Maximum likelihood estimation ECON 6002, Term II 2020 -21 14 Chapter 2 © Zhenlin Yang, SMU
Maximum likelihood estimation ECON 6002, Term II 2020 -21 15 Chapter 2 © Zhenlin Yang, SMU
MLE based on orthogonal transformation Chapter 2 To overcome the problem of ML estimation, we consider a orthogonal transformation to “sweep out” the fixed effects, and at the same time, adjust the df for the estimation of error variance. ECON 6002, Term II 2020 -21 16 © Zhenlin Yang, SMU
2. 3. One-way random effects model Chapter 2 v ECON 6002, Term II 2020 -21 17 © Zhenlin Yang, SMU
One-way random effects model Chapter 2 v ECON 6002, Term II 2020 -21 18 © Zhenlin Yang, SMU
Maximum likelihood estimation Chapter 2 v ECON 6002, Term II 2020 -21 19 © Zhenlin Yang, SMU
Maximum likelihood estimation Chapter 2 v ECON 6002, Term II 2020 -21 20 © Zhenlin Yang, SMU
Generalized least squares estimation Chapter 2 v ECON 6002, Term II 2020 -21 21 © Zhenlin Yang, SMU
2. 4. Fixed effects vs Random effects Chapter 2 There have been extensive discussions on issue of fixed effects versus random effects. Which one to choose? There is no easy answer to this question. FE model controls the unobserved heterogeneity across i, but effects of time-invariant variables, such as sex, race, religion, schooling, or union participation, cannot be estimated; With FE specification, prediction of the conditional mean is impossible, instead only changes in conditional mean caused by the changes or timevarying regressors can be predicted. RE model overcomes these difficulties, but the causal interpretation may then be unwarranted. See Hausman test in CH. 4. Correlated random effects model may be more suitable as it allows the fixed effects to correlate with (some) time-varying regressors linearly. This model specification (Mundlak, 1978) can be implemented using the RE estimation procedures, by adding the additional regressors. Hausman and Taylor’s (1981) approach may be another remedy. ECON 6002, Term II 2020 -21 22 © Zhenlin Yang, SMU
2. 5. Prediction Chapter 2 With the RE model specification and the estimated model, we can predict S periods ahead for the ith individual. ECON 6002, Term II 2020 -21 23 © Zhenlin Yang, SMU
2. 6. Examples Chapter 2 Example 2. 1. Gasoline demand data is a panel that consists of annual observations across 18 OECD countries, covering the period 1960 -1978. The data for this example are available as Gasolin. txt from: ttps: //www. wiley. com/legacy/wileychi/baltagi 3 e/ The Full Data has country ID, of the following form: COUNTRY AUSTRIA AUSTRIA AUSTRIA AUSTRIA Country. ID 1 1 1 1 ECON 6002, Term II 2020 -21 YEAR 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 LGASPCAR 4. 173244 4. 100989 4. 073177 4. 059509 4. 037689 4. 033983 4. 047537 4. 052911 4. 045507 4. 046355 4. 080888 4. 10672 4. 128018 4. 199381 24 LINCOMEP -6. 47428 -6. 42601 -6. 40731 -6. 37068 -6. 32225 -6. 29467 -6. 25255 -6. 23458 -6. 20689 -6. 15314 -6. 08171 -6. 04363 -5. 98105 -5. 89515 LRPMG -0. 33455 -0. 35133 -0. 37952 -0. 41425 -0. 44534 -0. 49706 -0. 46684 -0. 50588 -0. 52241 -0. 55911 -0. 59656 -0. 65446 -0. 59633 -0. 59445 LCARPCAP -9. 76684 -9. 60862 -9. 45726 -9. 34315 -9. 23774 -9. 1239 -9. 01982 -8. 9344 -8. 84797 -8. 78869 -8. 7282 -8. 6359 -8. 53834 -8. 48729 © Zhenlin Yang, SMU
Example 2. 1: Gasoline Demand Data Chapter 2 Baltagi and Griffin (1983) considered the gasoline demand equation, of Cobb-Douglas form, based on this panel data. Variables in the data file (Gasolin. M. xlsx) are: • COUNTRY = country name • Country. ID = country abbreviation • Year = year, 1960, . . . , 1978 • LGASPCAR = log of motor gasoline consumption per car • LINCOMEP = log of real per capita income • LRPMG = log of real motor gasoline price • LCARPCAP = log of stock of cars per capita ECON 6002, Term II 2020 -21 25 © Zhenlin Yang, SMU
Example 2. 1: Gasoline Demand Data Chapter 2 Table 2. 1 Gasoline Demand Data: The Between Estimation. . xtreg LGASPCAR LINCOMEP LRPMG LCARPCAP, be Between regression (regression on group means) Group variable: Country. ID Number of obs Number of groups R-sq: Obs per group: within = 0. 7337 between = 0. 8799 overall = 0. 8529 sd(u_i + avg(e_i. ))= F(3, 14) Prob > F . 1966886 = = 342 18 min = avg = max = 19 19. 0 19 = = 34. 19 0. 0000 ---------------------------------------LGASPCAR | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------+--------------------------------LINCOMEP |. 9675763. 1556662 6. 22 0. 000. 6337055 1. 301447 LRPMG | -. 9635503. 1329214 -7. 25 0. 000 -1. 248638 -. 6784622 LCARPCAP | -. 795299. 0824742 -9. 64 0. 000 -. 9721887 -. 6184094 _cons | 2. 54163. 5267845 4. 82 0. 000 1. 411789 3. 67147 ---------------------------------------ECON 6002, Term II 2020 -21 26 © Zhenlin Yang, SMU
Example 2. 1: Gasoline Demand Data Chapter 2 Table 2. 2 Gasoline Demand Data: The FE Estimation. . xtreg LGASPCAR LINCOMEP LRPMG LCARPCAP, fe Fixed-effects (within) regression Group variable: Country. ID Number of obs Number of groups R-sq: Obs per group: within = 0. 8396 between = 0. 5755 overall = 0. 6150 = = 342 18 min = avg = max = 19 19. 0 19 F(3, 321) = 560. 09 corr(u_i, Xb) = -0. 2468 Prob > F = 0. 0000 ---------------------------------------LGASPCAR | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------+--------------------------------LINCOMEP |. 6622498. 073386 9. 02 0. 000. 5178715. 8066282 LRPMG | -. 3217025. 0440992 -7. 29 0. 000 -. 4084626 -. 2349424 LCARPCAP | -. 6404829. 0296788 -21. 58 0. 000 -. 6988726 -. 5820933 _cons | 2. 40267. 2253094 10. 66 0. 000 1. 959401 2. 84594 -------+--------------------------------sigma_u |. 34841289 sigma_e |. 09233034 rho |. 93438173 (fraction of variance due to u_i) ---------------------------------------F test that all u_i=0: F(17, 321) = 83. 96 Prob > F = 0. 0000 ECON 6002, Term II 2020 -21 27 © Zhenlin Yang, SMU
Example 2. 1: Gasoline Demand Data Chapter 2 Table 2. 3 Gasoline Demand Data: The RE Estimation. . xtreg LGASPCAR LINCOMEP LRPMG LCARPCAP, re Random-effects GLS regression Group variable: Country. ID Number of obs Number of groups R-sq: Obs per group: within = 0. 8363 between = 0. 7099 overall = 0. 7309 = = 342 18 min = avg = max = 19 19. 0 19 Wald chi 2(3) = 1642. 20 corr(u_i, X) = 0 (assumed) Prob > chi 2 = 0. 0000 ---------------------------------------LGASPCAR | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------+--------------------------------LINCOMEP |. 5549858. 0591282 9. 39 0. 000. 4390967. 6708749 LRPMG | -. 4203893. 0399781 -10. 52 0. 000 -. 498745 -. 3420336 LCARPCAP | -. 6068402. 025515 -23. 78 0. 000 -. 6568487 -. 5568316 _cons | 1. 996699. 184326 10. 83 0. 000 1. 635427 2. 357971 -------+--------------------------------sigma_u |. 19554468 sigma_e |. 09233034 rho |. 81769856 (fraction of variance due to u_i) ---------------------------------------ECON 6002, Term II 2020 -21 28 © Zhenlin Yang, SMU
Example 2. 1: Gasoline Demand Data Chapter 2 Table 2. 4 Gasoline Demand Data: Swamy-Arora Estimation. . xtreg LGASPCAR LINCOMEP LRPMG LCARPCAP, re theta Random-effects GLS regression Group variable: Country. ID Number of obs Number of groups R-sq: Obs per group: within = 0. 8363 between = 0. 7099 overall = 0. 7309 Wald chi 2(3) Prob > chi 2 = = 342 18 min = avg = max = 19 19. 0 19 = = 1642. 20 0. 0000 corr(u_i, X) = 0 (assumed) theta =. 89230675 ---------------------------------------LGASPCAR | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------+--------------------------------LINCOMEP |. 5549858. 0591282 9. 39 0. 000. 4390967. 6708749 LRPMG | -. 4203893. 0399781 -10. 52 0. 000 -. 498745 -. 3420336 LCARPCAP | -. 6068402. 025515 -23. 78 0. 000 -. 6568487 -. 5568316 _cons | 1. 996699. 184326 10. 83 0. 000 1. 635427 2. 357971 -------+--------------------------------sigma_u |. 19554468 sigma_e |. 09233034 rho |. 81769856 (fraction of variance due to u_i) ---------------------------------------ECON 6002, Term II 2020 -21 29 © Zhenlin Yang, SMU
Example 2. 1: Gasoline Demand Data Chapter 2 Table 2. 5 Gasoline Demand Data: Maximum Likelihood Estimation. xtreg LGASPCAR LINCOMEP LRPMG LCARPCAP, mle Random-effects ML regression Group variable: Country. ID Number of obs Number of groups = = 342 18 Random effects u_i ~ Gaussian Obs per group: min = avg = max = 19 19. 0 19 LR chi 2(3) = 609. 75 Log likelihood = 282. 47697 Prob > chi 2 = 0. 0000 ---------------------------------------LGASPCAR | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------+--------------------------------LINCOMEP |. 5881334. 0659581 8. 92 0. 000. 4588578. 717409 LRPMG | -. 3780466. 0440663 -8. 58 0. 000 -. 464415 -. 2916782 LCARPCAP | -. 6163722. 0272054 -22. 66 0. 000 -. 6696938 -. 5630506 _cons | 2. 136168. 2156039 9. 91 0. 000 1. 713593 2. 558744 -------+--------------------------------/sigma_u |. 2922939. 0545496. 2027512. 4213821 /sigma_e |. 0922537. 0036482. 0853734. 0996885 rho |. 9094086. 0317608. 8303747. 9571561 ---------------------------------------LR test of sigma_u=0: chibar 2(01) = 463. 97 Prob >= chibar 2 = 0. 000 ECON 6002, Term II 2020 -21 30 © Zhenlin Yang, SMU
Example 2. 2: Public capital productivity Chapter 2 The data, from Munnell (1990), gives indicators related to public capital productivity for 48 US states observed over 17 years (19701986). It can be downloaded by clicking the link below: http: //people. stern. nyu. edu/wgreene/Econometrics/Panel. Data. Econometrics. htm and then choosing “Panel Data Sets”. It has been extensively used for illustrating the applications of the regular panel data models, and recently the applications of spatial panel data models. Full Data STATE ALABAMA ALABAMA ALABAMA ALABAMA STATE 0 1 1 1 1 ECON 6002, Term II 2020 -21 YR 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 P_CAP 15032. 67 15501. 94 15972. 41 16406. 26 16762. 67 17316. 26 17732. 86 18111. 93 18479. 74 18881. 49 19012. 34 19118. 52 19118. 25 19122 HWY 7325. 8 7525. 94 7765. 42 7907. 66 8025. 52 8158. 23 8228. 19 8365. 67 8510. 64 8640. 61 8663. 5 8628. 83 8645. 14 8612. 47 WATER 1655. 68 1721. 02 1764. 75 1742. 41 1734. 85 1752. 27 1799. 74 1845. 11 1960. 51 2081. 91 2138. 52 2218. 91 2215. 84 2230. 91 31 UTIL 6051. 2 6254. 98 6442. 23 6756. 19 7002. 29 7405. 76 7704. 93 7901. 15 8008. 59 8158. 97 8210. 33 8270. 79 8257. 26 8278. 63 PC 35793. 8 37299. 91 38670. 3 40084. 01 42057. 31 43971. 71 50221. 57 51084. 99 52604. 05 54525. 86 56589. 16 56481. 93 58021. 69 58893. 97 GSP 28418 29375 31303 33430 33749 33604 35764 37463 39964 40979 40380 41105 40328 42245 EMP 1010. 5 1021. 9 1072. 3 1135. 5 1169. 8 1155. 4 1207 1269. 2 1336. 5 1362 1356. 1 1347. 6 1312. 5 1328. 8 UNEMP 4. 7 5. 2 4. 7 3. 9 5. 5 7. 7 6. 8 7. 4 6. 3 7. 1 8. 8 11 14 14 © Zhenlin Yang, SMU
Example 2. 2: Public capital productivity Chapter 2 Variables in the data file (productivitym. csv) are: • STATE = state name • STATE 0 = state abbreviation • YR = year, 1970, . . . , 1986 • P_CAP = public capital • HWY = highway capital • WATER = water utility capital • UTIL = utility capital • PC = private capital • GSP = gross state product • EMP = employment (labour input) • UNEMP = unemployment rate See Baltagi (2005, p. 25) for the analysis of these data. The article on which the analysis is based is Munnell, A. , "Why has Productivity Declined? Productivity and Public Investment, " New England Economic Review, 1990, pp. 3 -22. The data can also be downloaded from the website for Baltagi's text: https: //www. wiley. com/legacy/wileychi/baltagi 3 e/ ECON 6002, Term II 2020 -21 32 © Zhenlin Yang, SMU
Example 2. 2: Public capital productivity Chapter 2 Table 2. 6 Public Capital Productivity Data: The Between Estimation. . xtreg ln_gsp ln_pcap ln_pc ln_emp unemp, be Between regression (regression on group means) Group variable: state 0 Number of obs Number of groups R-sq: Obs per group: within = 0. 9330 between = 0. 9939 overall = 0. 9925 sd(u_i + avg(e_i. ))= F(4, 43) Prob > F . 0832062 = = 816 48 min = avg = max = 17 17. 0 17 = = 1754. 11 0. 0000 ---------------------------------------ln_gsp | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------+--------------------------------ln_pcap |. 1793651. 0719719 2. 49 0. 017. 0342199. 3245104 ln_pc |. 3019542. 0418215 7. 22 0. 000. 2176132. 3862953 ln_emp |. 5761274. 0563746 10. 22 0. 000. 4624372. 6898176 unemp | -. 0038903. 0099084 -0. 39 0. 697 -. 0238724. 0160918 _cons | 1. 589444. 2329796 6. 82 0. 000 1. 119596 2. 059292 ---------------------------------------ECON 6002, Term II 2020 -21 33 © Zhenlin Yang, SMU
Example 2. 2: Public capital productivity Chapter 2 Table 2. 7 Public Capital Productivity Data: RE Estimation. . xtreg ln_gsp ln_pcap ln_pc ln_emp unemp Random-effects GLS regression Group variable: state 0 Number of obs Number of groups R-sq: Obs per group: within = 0. 9412 between = 0. 9928 overall = 0. 9917 = = 816 48 min = avg = max = 17 17. 0 17 Wald chi 2(4) = 19131. 09 corr(u_i, X) = 0 (assumed) Prob > chi 2 = 0. 0000 ---------------------------------------ln_gsp | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------+--------------------------------ln_pcap |. 0044388. 0234173 0. 19 0. 850 -. 0414583. 0503359 ln_pc |. 3105483. 0198047 15. 68 0. 000. 2717317. 3493649 ln_emp |. 7296705. 0249202 29. 28 0. 000. 6808278. 7785132 unemp | -. 0061725. 0009073 -6. 80 0. 000 -. 0079507 -. 0043942 _cons | 2. 135411. 1334615 16. 00 0. 000 1. 873831 2. 39699 -------+--------------------------------sigma_u |. 0826905 sigma_e |. 03813705 rho |. 82460109 (fraction of variance due to u_i) ---------------------------------------ECON 6002, Term II 2020 -21 34 © Zhenlin Yang, SMU
Example 2. 2: Public capital productivity Chapter 2 Table 2. 8 Public Capital Productivity Data: FE Estimation. . xtreg ln_gsp ln_pcap ln_pc ln_emp unemp, fe Fixed-effects (within) regression Group variable: state 0 Number of obs Number of groups R-sq: Obs per group: within = 0. 9413 between = 0. 9921 overall = 0. 9910 = = 816 48 min = avg = max = 17 17. 0 17 F(4, 764) = 3064. 81 corr(u_i, Xb) = 0. 0608 Prob > F = 0. 0000 ---------------------------------------ln_gsp | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------+--------------------------------ln_pcap | -. 0261493. 0290016 -0. 90 0. 368 -. 0830815. 0307829 ln_pc |. 2920067. 0251197 11. 62 0. 000. 2426949. 3413185 ln_emp |. 7681595. 0300917 25. 53 0. 000. 7090872. 8272318 unemp | -. 0052977. 0009887 -5. 36 0. 000 -. 0072387 -. 0033568 _cons | 2. 352898. 1748131 13. 46 0. 000 2. 009727 2. 696069 -------+--------------------------------sigma_u |. 09057293 sigma_e |. 03813705 rho |. 8494045 (fraction of variance due to u_i) ---------------------------------------F test that all u_i=0: F(47, 764) = 75. 82 Prob > F = 0. 0000 ECON 6002, Term II 2020 -21 35 © Zhenlin Yang, SMU
Example 2. 2: Public capital productivity Chapter 2 Table 2. 9 Public Capital Productivity Data: Swamy-Aroma Estimator. xtreg ln_gsp ln_pcap ln_pc ln_emp unemp, re theta Random-effects GLS regression Group variable: state 0 Number of obs Number of groups R-sq: Obs per group: within = 0. 9412 between = 0. 9928 overall = 0. 9917 Wald chi 2(4) Prob > chi 2 = = 816 48 min = avg = max = 17 17. 0 17 = = 19131. 09 0. 0000 corr(u_i, X) = 0 (assumed) theta =. 8888353 ---------------------------------------ln_gsp | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------+--------------------------------ln_pc |. 3105483. 0198047 15. 68 0. 000. 2717317. 3493649 ln_pcap |. 0044388. 0234173 0. 19 0. 850 -. 0414583. 0503359 ln_emp |. 7296705. 0249202 29. 28 0. 000. 6808278. 7785132 unemp | -. 0061725. 0009073 -6. 80 0. 000 -. 0079507 -. 0043942 _cons | 2. 135411. 1334615 16. 00 0. 000 1. 873831 2. 39699 -------+--------------------------------sigma_u |. 0826905 sigma_e |. 03813705 rho |. 82460109 (fraction of variance due to u_i) ---------------------------------------ECON 6002, Term II 2020 -21 36 © Zhenlin Yang, SMU
Example 2. 2: Public capital productivity Chapter 2 Table 2. 10 Public Capital Productivity Data: MLE. xtreg ln_gsp ln_pcap ln_pc ln_emp unemp, mle Random-effects ML regression Group variable: state 0 Number of obs Number of groups = = 816 48 Random effects u_i ~ Gaussian Obs per group: min = avg = max = 17 17. 0 17 LR chi 2(4) = 2412. 91 Log likelihood = 1401. 9041 Prob > chi 2 = 0. 0000 ---------------------------------------ln_gsp | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------+--------------------------------ln_pcap |. 0031446. 0239185 0. 13 0. 895 -. 0437348. 050024 ln_pc |. 309811. 020081 15. 43 0. 000. 270453. 349169 ln_emp |. 7313372. 0256936 28. 46 0. 000. 6809787. 7816957 unemp | -. 0061382. 0009143 -6. 71 0. 000 -. 0079302 -. 0043462 _cons | 2. 143865. 1376582 15. 57 0. 000 1. 87406 2. 413671 -------+--------------------------------/sigma_u |. 085162. 0090452. 0691573. 1048706 /sigma_e |. 0380836. 0009735. 0362226. 0400402 rho |. 8333481. 0304597. 7668537. 8861754 ---------------------------------------LR test of sigma_u=0: chibar 2(01) = 1149. 84 Prob >= chibar 2 = 0. 000 ECON 6002, Term II 2020 -21 37 © Zhenlin Yang, SMU