assignment 1: solutionassignment 1: solution. econ686 panel data analysis, term ii 2019-20 . due...

16
SMU Classification: Restricted Assignment 1: Solution ECON686 Panel Data Analysis, Term II 2019-20 Due date: April 3, 2020, 5:00pm Submission: Email your answers to [email protected] in one pdf file, with file name: YourName_A1.pdf, and email Subject: ECON686 Assignment 1 1. Consider the panel data model with individual specific effects: = + + + , where i = 1, , N and t = 1, , T, and are iid N(0, 2 ). (a) Consider { } as fixed effects and set =0. Show that the Within, LSDV and maximum likelihood estimators of are identical. (For LSDV, you need to use the inverse of a partitioned matrix described in pp. 21, Chapter 1 of lecture notes.) (b) Verify the results in (a) numerically by estimating the gasoline demand equation using the gasoline demand data, as described in Baltagi (2005, pp. 23). (c) Consider { } as random effects and 0. Derive the maximum likelihood estimators for and . Compare the MLE of with the corresponding FE estimator given in (a). Estimate the RE model using the gasoline demand data and discuss the results. Solution:

Upload: others

Post on 15-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

Assignment 1: Solution

ECON686 Panel Data Analysis, Term II 2019-20

Due date: April 3, 2020, 5:00pm Submission: Email your answers to [email protected] in one pdf file, with file name: YourName_A1.pdf, and email Subject: ECON686 Assignment 1 1. Consider the panel data model with individual specific effects:

𝑦𝑦𝑖𝑖𝑖𝑖 = 𝛼𝛼 + 𝑋𝑋𝑖𝑖𝑖𝑖′ 𝛽𝛽 + 𝜇𝜇𝑖𝑖 + 𝑣𝑣𝑖𝑖𝑖𝑖,

where i = 1, …, N and t = 1, …, T, and 𝑣𝑣𝑖𝑖𝑖𝑖 are iid N(0, 𝜎𝜎𝑣𝑣2).

(a) Consider {𝜇𝜇𝑖𝑖} as fixed effects and set 𝛼𝛼 = 0. Show that the Within, LSDV and maximum likelihood estimators of 𝛽𝛽 are identical. (For LSDV, you need to use the inverse of a partitioned matrix described in pp. 21, Chapter 1 of lecture notes.)

(b) Verify the results in (a) numerically by estimating the gasoline demand equation using the gasoline demand data, as described in Baltagi (2005, pp. 23).

(c) Consider {𝜇𝜇𝑖𝑖} as random effects and 𝛼𝛼 ≠ 0. Derive the maximum likelihood estimators for 𝛼𝛼 and 𝛽𝛽. Compare the MLE of 𝛽𝛽 with the corresponding FE estimator given in (a). Estimate the RE model using the gasoline demand data and discuss the results.

Solution:

Page 2: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

(b) Numerical verification. The gasoline demand data is described as follows: Source: Baltagi and Griffin (1983). Description: Panel Data, 18 OECD countries over 19 years, 1960-1978. Variables: (1) CO = Country. (2) YR = Year. (3) LN(Gas/Car): The logarithm of motor gasoline consumption per auto. (4) LN(Y/N): The logarithm of real per-capita income. (5) LN(Pmg/Pgdp): The logarithm of real motor gasoline price. (6) LN(Car/N): The logarithm of the stock of cars per-capita.

We fit the model: LN �GasCar� = 𝛼𝛼+ 𝛽𝛽1LN �Y

N� + 𝛽𝛽2LN �Pmg

Pgdp� + 𝛽𝛽3LN �Car

N� + 𝑢𝑢𝑖𝑖𝑖𝑖,

based on three estimation methods described in (a).

Page 3: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

The LSDV Estimation: using regress procedure

. regress LGASPCAR LINCOMEP LRPMG LCARPCAP i.CountryID

Source | SS df MS Number of obs = 342

-------------+---------------------------------- F(20, 321) = 586.56

Model | 100.00647 20 5.00032352 Prob > F = 0.0000

Residual | 2.73649024 321 .008524892 R-squared = 0.9734

-------------+---------------------------------- Adj R-squared = 0.9717

Total | 102.742961 341 .301299005 Root MSE = .09233

------------------------------------------------------------------------------

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 CountryID | . . . _cons | 2.285856 .2283235 10.01 0.000 1.836657 2.735056

------------------------------------------------------------------------------

The LSDV Estimation: using areg procedure

. areg LGASPCAR LINCOMEP LRPMG LCARPCAP, absorb(CountryID)

Linear regression, absorbing indicators Number of obs = 342

Absorbed variable: CountryID No. of categories = 18

F( 3, 321) = 560.09

Prob > F = 0.0000

R-squared = 0.9734

Adj R-squared = 0.9717

Root MSE = 0.0923

------------------------------------------------------------------------------

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

------------------------------------------------------------------------------

F test of absorbed indicators: F(17, 321) = 83.961 Prob > F = 0.000

Page 4: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

The Within Estimation:

. xtreg LGASPCAR LINCOMEP LRPMG LCARPCAP, fe

Fixed-effects (within) regression Number of obs = 342

Group variable: CountryID Number of groups = 18

R-sq: Obs per group:

within = 0.8396 min = 19

between = 0.5755 avg = 19.0

overall = 0.6150 max = 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

The maximum likelihood estimation: . xtmixed LGASPCAR LINCOMEP LRPMG LCARPCAP i.CountryID, mle

Mixed-effects ML regression Number of obs = 342

Wald chi2(20) = 12498.57

Log likelihood = 340.33403 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

LGASPCAR | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

LINCOMEP | .6622498 .0710973 9.31 0.000 .5229018 .8015979

LRPMG | -.3217025 .0427239 -7.53 0.000 -.4054398 -.2379652

LCARPCAP | -.6404829 .0287532 -22.28 0.000 -.6968382 -.5841276

Page 5: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

CountryID |

. . .

_cons | 2.285856 .2212025 10.33 0.000 1.852308 2.719405

------------------------------------------------------------------------------

------------------------------------------------------------------------------

Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]

-----------------------------+------------------------------------------------

sd(Residual) | .0894507 .0034202 .0829922 .0964118

------------------------------------------------------------------------------

Indeed the LSDV, Within and ML estimators of the 𝛽𝛽-coefficients are identical, but the estimates of the intercept 𝛼𝛼 are different. MLE offers slightly different standard errors. (c) RE Estimation based on the Gasoline Demand Data. . xtreg LGASPCAR LINCOMEP LRPMG LCARPCAP, re

Random-effects GLS regression Number of obs = 342

Group variable: CountryID Number of groups = 18

R-sq: Obs per group:

within = 0.8363 min = 19

between = 0.7099 avg = 19.0

overall = 0.7309 max = 19

Wald chi2(3) = 1642.20

corr(u_i, X) = 0 (assumed) Prob > chi2 = 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)

------------------------------------------------------------------------------

Discussion: All three variables are highly significant to the response Ln(Gas/Car), with estimates, standard errors, and inference statistics being very similar to those from the FE (Within) estimation.

Page 6: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

2. Consider the panel data model with individual and time specific effects:

𝑦𝑦𝑖𝑖𝑖𝑖 = 𝛼𝛼 + 𝑋𝑋𝑖𝑖𝑖𝑖′ 𝛽𝛽 + 𝜇𝜇𝑖𝑖 + 𝜆𝜆𝑖𝑖 + 𝑣𝑣𝑖𝑖𝑖𝑖,

where i = 1, …, N and t = 1, …, T, and 𝑣𝑣𝑖𝑖𝑖𝑖 are iid N(0, 𝜎𝜎𝑣𝑣2).

(a) Consider {𝜇𝜇𝑖𝑖} and {𝜆𝜆𝑖𝑖} as fixed effects and set 𝛼𝛼 = 0. Show that the LSDV estimator and maximum likelihood estimator of 𝛽𝛽 are identical to the LSDV Within estimator.

(b) Consider {𝜇𝜇𝑖𝑖} and {𝜆𝜆𝑖𝑖} as random effects and 𝛼𝛼 ≠ 0. Derive the maximum likelihood estimator of 𝛽𝛽.

(c) Using Munnell’s (1990) public capital productivity data, estimate the model using the methods involved in (a) and (b) and discuss the results.

Solution:

Page 7: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

(c)

Two-Way FE estimation, the Within Estimation

. xtreg ln_gsp ln_pcap ln_pc ln_emp unemp i.yr, fe

Fixed-effects (within) regression Number of obs = 816

Group variable: state0 Number of groups = 48

R-sq: Obs per group:

within = 0.9536 min = 17

between = 0.9890 avg = 17.0

overall = 0.9879 max = 17

F(20,748) = 768.12

corr(u_i, Xb) = 0.7201 Prob > F = 0.0000

------------------------------------------------------------------------------

ln_gsp | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

ln_pcap | -.0301757 .0269365 -1.12 0.263 -.0830559 .0227046

ln_pc | .1688277 .0276563 6.10 0.000 .1145344 .2231209

Page 8: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

ln_emp | .7693063 .0281418 27.34 0.000 .71406 .8245526

unemp | -.0042211 .0011388 -3.71 0.000 -.0064568 -.0019854

|

yr |

1971 | .015136 .0071182 2.13 0.034 .001162 .02911

. . . |

|

_cons | 3.637237 .2576731 14.12 0.000 3.131389 4.143086

-------------+----------------------------------------------------------------

sigma_u | .15633758

sigma_e | .0342888

rho | .95410413 (fraction of variance due to u_i)

------------------------------------------------------------------------------ F test that all u_i=0: F(47, 748) = 93.80 Prob > F = 0.0000

LSDV Estimation

. areg ln_gsp ln_pcap ln_pc ln_emp unemp i.yr, absorb(state0)

Linear regression, absorbing indicators Number of obs = 816

Absorbed variable: state0 No. of categories = 48

F( 20, 748) = 768.12

Prob > F = 0.0000

R-squared = 0.9990

Adj R-squared = 0.9989

Root MSE = 0.0343

------------------------------------------------------------------------------

ln_gsp | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

ln_pcap | -.0301757 .0269365 -1.12 0.263 -.0830559 .0227046

ln_pc | .1688277 .0276563 6.10 0.000 .1145344 .2231209

ln_emp | .7693063 .0281418 27.34 0.000 .71406 .8245526

unemp | -.0042211 .0011388 -3.71 0.000 -.0064568 -.0019854

|

yr |

1971 | .015136 .0071182 2.13 0.034 .001162 .02911

. . . | .029522 .0072532 4.07 0.000 .0152829 .0437612

|

_cons | 3.637237 .2576731 14.12 0.000 3.131389 4.143086

------------------------------------------------------------------------------

F test of absorbed indicators: F(47, 748) = 93.802 Prob > F = 0.000

Page 9: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

Two-Way Fixed Effects Estimation: MLE

. xtmixed ln_gsp ln_pcap ln_pc ln_emp unemp i.state0 i.yr, mle

Mixed-effects ML regression Number of obs = 816

Wald chi2(67) = 787690.37

Log likelihood = 1629.9629 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

ln_gsp | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

ln_pcap | -.0301757 .0257898 -1.17 0.242 -.0807227 .0203714

ln_pc | .1688277 .0264789 6.38 0.000 .1169299 .2207254

ln_emp | .7693063 .0269437 28.55 0.000 .7164975 .822115

unemp | -.0042211 .0010904 -3.87 0.000 -.0063582 -.002084

|

state0 |

2 | .1130742 .0147484 7.67 0.000 .0841679 .1419805

. . .

|

yr |

1971 | .015136 .0068151 2.22 0.026 .0017785 .0284934

. . .

|

_cons | 3.515951 .2512684 13.99 0.000 3.023474 4.008428

------------------------------------------------------------------------------

------------------------------------------------------------------------------

Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]

-----------------------------+------------------------------------------------

sd(Residual) | .032829 .0008126 .0312743 .034461

------------------------------------------------------------------------------

As the theory predicts, the Within, LSDV, and the ML estimators of the two-way FE model give identical values for the estimated 𝛽𝛽-coefficients. The estimated standard errors of the estimated 𝛽𝛽-coefficients from ML estimation are slightly different from those under Within or LSDV methods. The results from the two-way random effects estimation, given below, are somewhat different from the results from the FE estimation. The sign of the coefficient of the ln_pcap variable is different from those from the FE models, although both are insignificant. These might be an indication that the FE model is more appropriate.

Page 10: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

Two-Way Random Effects Estimation: MLE

. xtmixed ln_gsp ln_pcap ln_pc ln_emp unemp ||_all: R.yr|| state0:, mle

Performing EM optimization:

Performing gradient-based optimization:

Iteration 0: log likelihood = 1450.8421

Iteration 1: log likelihood = 1450.8421

Computing standard errors:

Mixed-effects ML regression Number of obs = 816

-------------------------------------------------------------

| No. of Observations per Group

Group Variable | Groups Minimum Average Maximum

----------------+--------------------------------------------

_all | 1 816 816.0 816

state0 | 48 17 17.0 17

-------------------------------------------------------------

Wald chi2(4) = 9105.50

Log likelihood = 1450.8421 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

ln_gsp | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

ln_pcap | .0202634 .0235846 0.86 0.390 -.0259617 .0664884

ln_pc | .2498939 .0219219 11.40 0.000 .2069279 .29286

ln_emp | .7497823 .0241874 31.00 0.000 .7023758 .7971888

unemp | -.0043719 .0010576 -4.13 0.000 -.0064447 -.002299

_cons | 2.470481 .1461092 16.91 0.000 2.184112 2.756849

------------------------------------------------------------------------------

------------------------------------------------------------------------------

Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]

-----------------------------+------------------------------------------------

_all: Identity |

sd(R.yr) | .0165187 .003275 .0112 .0243632

-----------------------------+------------------------------------------------

state0: Identity |

sd(_cons) | .0909035 .0102736 .0728418 .1134436

-----------------------------+------------------------------------------------

sd(Residual) | .0346826 .0009032 .0329567 .0364989

------------------------------------------------------------------------------

LR test vs. linear model: chi2(2) = 1247.72 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

Page 11: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

3. Download the “Spanish Dairy Farm Production” data from the website: http://people.stern.nyu.edu/wgreene/Econometrics/PanelDataEconometrics.htm

(a) Write a paragraph to introduce the data, including the variables names, number of cross-sectional units and time periods, purpose of study, etc.

(b) Using the data, demonstrate the applications of the Stata command xtreg with options (be, fe, re, mle), in fitting the one-way effects panel model. Explain briefly your results.

(c) Extend your analysis by including the time-specific effects to fit (i) two-way fixed effects model and (ii) a mixed model with individual random effects and time-fixed effects. Explain briefly your results.

(d) Using the Stata command xtmixed, fit a two-way random effects model to the data. Explain your results.

Solution:

(a) Spanish Dairy Farm Production, N = 247, T = 6 Variables in the file are FARM = Farm ID YEAR = year, 93, 94, ..., 98

Input variables: COWS: number of cows LAND: land size in hectares LABOR: number of works FEED: amount of food fed X1, X2, X3, X4: log of input variables, deviations from means (in logs) X11, X22, X33, X44: squares of X1, X2, X3, X4 X12, X13, X14,X23, X24, X34: cross product of X1, X2, X3, X4 YEAR93,…, YEAR98 = year dummy variables Output MILK = milk production each farm in each year YIT = log of MILK production Purpose of Study Identify factors determining the Spanish dairy farm production, and specify a ‘good’ panel data model for predicting the milk production.

(b) The outputs for xtreg with (be, fe, re, mle): by regressing YIT on X1, X2, X3, X4:

. xtreg yit x1 x2 x3 x4, be

Between regression (regression on group means) Number of obs = 1,482

Group variable: farm Number of groups = 247

R-sq: Obs per group:

within = 0.8309 min = 6

between = 0.9634 avg = 6.0

overall = 0.9524 max = 6

Page 12: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

F(4,242) = 1593.64

sd(u_i + avg(e_i.))= .1191294 Prob > F = 0.0000

------------------------------------------------------------------------------

yit | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

x1 | .5625965 .0475769 11.82 0.000 .4688788 .6563142

x2 | .0254032 .0260339 0.98 0.330 -.0258787 .0766851

x3 | .0154496 .0292668 0.53 0.598 -.0422006 .0730998

x4 | .4779786 .0265409 18.01 0.000 .425698 .5302591

_cons | 11.57749 .00758 1527.37 0.000 11.56256 11.59242

------------------------------------------------------------------------------

. xtreg yit x1 x2 x3 x4, fe

Fixed-effects (within) regression Number of obs = 1,482

Group variable: farm Number of groups = 247

R-sq: Obs per group:

within = 0.8359 min = 6

between = 0.9615 avg = 6.0

overall = 0.9513 max = 6

F(4,1231) = 1568.11

corr(u_i, Xb) = 0.1089 Prob > F = 0.0000

------------------------------------------------------------------------------

yit | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

x1 | .6620012 .0246784 26.83 0.000 .6135847 .7104177

x2 | .0373524 .0161331 2.32 0.021 .005701 .0690038

x3 | .0303996 .0232078 1.31 0.190 -.0151316 .0759307

x4 | .3825104 .0120169 31.83 0.000 .3589345 .4060862

_cons | 11.57749 .0021151 5473.85 0.000 11.57334 11.58164

-------------+----------------------------------------------------------------

sigma_u | .12198441

sigma_e | .08142265

rho | .69178541 (fraction of variance due to u_i)

------------------------------------------------------------------------------

F test that all u_i=0: F(246, 1231) = 12.84 Prob > F = 0.0000

. xtreg yit x1 x2 x3 x4, re

Random-effects GLS regression Number of obs = 1,482

Group variable: farm Number of groups = 247

R-sq: Obs per group:

within = 0.8358 min = 6

between = 0.9621 avg = 6.0

overall = 0.9518 max = 6

Wald chi2(4) = 12563.20

corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000

------------------------------------------------------------------------------

yit | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

x1 | .6502721 .0208835 31.14 0.000 .6093412 .691203

Page 13: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

x2 | .0300488 .0133827 2.25 0.025 .0038193 .0562784

x3 | .03507 .0173829 2.02 0.044 .0010002 .0691398

x4 | .3995279 .0108786 36.73 0.000 .3782062 .4208497

_cons | 11.57749 .0076015 1523.04 0.000 11.56259 11.59239

-------------+----------------------------------------------------------------

sigma_u | .11439792

sigma_e | .08142265

rho | .66375185 (fraction of variance due to u_i)

------------------------------------------------------------------------------

. xtreg yit x1 x2 x3 x4, mle

Fitting constant-only model:

Iteration 0: log likelihood = -221.37283

Iteration 1: log likelihood = -221.35168

Fitting full model:

Iteration 0: log likelihood = 1284.8672

Iteration 1: log likelihood = 1297.033

Iteration 2: log likelihood = 1297.1861

Iteration 3: log likelihood = 1297.1861

Random-effects ML regression Number of obs = 1,482

Group variable: farm Number of groups = 247

Random effects u_i ~ Gaussian Obs per group:

min = 6

avg = 6.0

max = 6

LR chi2(4) = 3037.08

Log likelihood = 1297.1861 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

yit | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

x1 | .6505191 .0208955 31.13 0.000 .6095647 .6914734

x2 | .0301504 .0133864 2.25 0.024 .0039136 .0563873

x3 | .0350755 .0173955 2.02 0.044 .0009809 .06917

x4 | .3992413 .0109443 36.48 0.000 .3777909 .4206918

_cons | 11.57749 .0076555 1512.32 0.000 11.56248 11.59249

-------------+----------------------------------------------------------------

/sigma_u | .115638 .0056798 .1050248 .1273236

/sigma_e | .0813718 .0016398 .0782205 .08465

rho | .6688242 .0238522 .6208686 .7141585

------------------------------------------------------------------------------

LR test of sigma_u=0: chibar2(01) = 975.02 Prob >= chibar2 = 0.000

Page 14: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

i) All four estimation methods show that X1 (COWS) and X4 (FEED) are highly significant to the MILK production;

ii) The X2 (LAND) and X3 (LABOR) are insignificant in be estimation, X2 (LAND) is significant at 5% level in fe, re and mle estimation; and X3 (LABOR) is also significant in re and mle estimation but not in fe estimation at 5% level.

iii) The highly significance of X1 and X4 suggest that their squared terms and cross-product may be included in the model. However, an fe estimation of such a model does show much of improvements in terms of overall model fitting.

iv) The re and mle estimation methods produce similar results.

(c) The outputs for xtreg (fe and re) on X1, X2, X3, X4, and time dummies: . xtreg yit x1 x2 x3 x4 i.year, fe

Fixed-effects (within) regression Number of obs = 1,482

Group variable: farm Number of groups = 247

R-sq: Obs per group:

within = 0.8517 min = 6

between = 0.9593 avg = 6.0

overall = 0.9493 max = 6

F(9,1226) = 782.05

corr(u_i, Xb) = 0.4929 Prob > F = 0.0000

------------------------------------------------------------------------------

yit | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

x1 | .6379655 .0237985 26.81 0.000 .5912751 .6846559

x2 | .0412755 .0154446 2.67 0.008 .0109747 .0715763

x3 | .0281924 .0221732 1.27 0.204 -.0153093 .071694

x4 | .3081603 .0132257 23.30 0.000 .2822127 .3341078

|

year |

94 | .0329188 .0071309 4.62 0.000 .0189286 .046909

95 | .0613667 .0074861 8.20 0.000 .0466797 .0760537

96 | .0719498 .0080094 8.98 0.000 .0562361 .0876635

97 | .0753031 .0084325 8.93 0.000 .0587594 .0918468

98 | .0940052 .0089244 10.53 0.000 .0764965 .111514

|

_cons | 11.52156 .0057982 1987.08 0.000 11.51019 11.53294

-------------+----------------------------------------------------------------

sigma_u | .14561471

sigma_e | .07758351

rho | .77889157 (fraction of variance due to u_i)

------------------------------------------------------------------------------

F test that all u_i=0: F(246, 1226) = 14.54 Prob > F = 0.0000

Page 15: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

Adding the time dummies to the fe estimation seems improve the overall model fitting. The X1 and X4 remain highly significant, X2 becomes more significant with p-value 0.008, and the time dummies are all highly significant. The X3 remains insignificant. Adding the time dummies to the re estimation also improves the overall model fitting. The X1 and X4 remain highly significant, X2 and X3 become more significant with p-values 0.004 and 0.001, respectively, and the time dummies are all highly significant.

. xtreg yit x1 x2 x3 x4 i.year, re

Random-effects GLS regression Number of obs = 1,482

Group variable: farm Number of groups = 247

R-sq: Obs per group:

within = 0.8498 min = 6

between = 0.9605 avg = 6.0

overall = 0.9510 max = 6

Wald chi2(9) = 12872.02

corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000

------------------------------------------------------------------------------

yit | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

x1 | .6622073 .0205154 32.28 0.000 .6219979 .7024166

x2 | .0376141 .0131975 2.85 0.004 .0117475 .0634808

x3 | .0551804 .0173129 3.19 0.001 .0212478 .089113

x4 | .353735 .0117757 30.04 0.000 .330655 .3768149

|

year |

94 | .0263511 .007207 3.66 0.000 .0122256 .0404765

95 | .0489399 .0074386 6.58 0.000 .0343606 .0635193

96 | .0528781 .0077166 6.85 0.000 .0377538 .0680024

97 | .0522242 .0079423 6.58 0.000 .0366575 .0677909

98 | .0664853 .0081929 8.11 0.000 .0504275 .0825432

|

_cons | 11.53634 .0092748 1243.83 0.000 11.51816 11.55452

-------------+----------------------------------------------------------------

sigma_u | .11484174

sigma_e | .07758351

rho | .68662771 (fraction of variance due to u_i)

------------------------------------------------------------------------------

(d) The two-way RE model is fitted using the general Stata command xtmixed with options: || _all: R.year || farm:, mle. It produces results very similar to those by xtreg yit x1 x2 x3 x4 i.year, re

Page 16: Assignment 1: SolutionAssignment 1: Solution. ECON686 Panel Data Analysis, Term II 2019-20 . Due date: April 3, 2020, 5:00pm . Submission: Email your answers to . zlyang@smu.edu.sg

SMU Classification: Restricted

The difference between two-way FE and two-way RE estimation suggest more need to be done in choosing a panel model with FE or RE. . xtmixed yit x1 x2 x3 x4 || _all: R.year || farm:, mle

Performing EM optimization:

Performing gradient-based optimization:

Iteration 0: log likelihood = 1325.9818

Iteration 1: log likelihood = 1325.9818

Computing standard errors:

Mixed-effects ML regression Number of obs = 1,482

-------------------------------------------------------------

| No. of Observations per Group

Group Variable | Groups Minimum Average Maximum

----------------+--------------------------------------------

_all | 1 1,482 1,482.0 1,482

farm | 247 6 6.0 6

-------------------------------------------------------------

Wald chi2(4) = 8784.31

Log likelihood = 1325.9818 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

yit | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

x1 | .6618469 .0205223 32.25 0.000 .621624 .7020698

x2 | .0376961 .0132336 2.85 0.004 .0117588 .0636334

x3 | .0537612 .0174256 3.09 0.002 .0196076 .0879148

x4 | .3543165 .0116974 30.29 0.000 .33139 .3772429

_cons | 11.57749 .0120504 960.76 0.000 11.55387 11.60111

------------------------------------------------------------------------------

------------------------------------------------------------------------------

Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]

-----------------------------+------------------------------------------------

_all: Identity |

sd(R.year) | .0220552 .0069488 .011894 .0408974

-----------------------------+------------------------------------------------

farm: Identity |

sd(_cons) | .1217421 .0061302 .110301 .1343699

-----------------------------+------------------------------------------------

sd(Residual) | .0782755 .0015957 .0752097 .0814664

------------------------------------------------------------------------------

LR test vs. linear model: chi2(2) = 1032.61 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.