Dear Stata users,
I am a novice stata user, so this could be a silly question.
I am trying to estimate the one-way fixed effect estimator using Grunfeld data. It includes investment data for 10 firms from 1935 to 1954.
First, I tried to estimate the estimator without using 'xtreg' as follows
'
The result is
When I regress using 'xtreg', the result of constant term is different.
I don't understand why only the constant term is different from the previous one. Can someone please explain about this?
I am a novice stata user, so this could be a silly question.
I am trying to estimate the one-way fixed effect estimator using Grunfeld data. It includes investment data for 10 firms from 1935 to 1954.
First, I tried to estimate the estimator without using 'xtreg' as follows
'
Code:
* Use Grunfeld data import excel using "Grunfeld.xlsx", firstrow xtset firm year ***** Balanced Case ***** *** One-Way *** * Fixed Effect Regression * egen inv_mean1 = mean(inv), by(firm) gen inv_dot = inv - inv_mean1 egen value_mean1 = mean(value), by(firm) gen value_dot = value - value_mean1 egen capital_mean1 = mean(capital), by(firm) gen capital_dot = capital - capital_mean1 reg inv_dot value_dot capital_dot, vce(cl firm)
Code:
. reg inv_dot value_dot capital_dot, vce(cl firm) Linear regression Number of obs = > 200 F(2, 9) = > 28.31 Prob > F = > 0.0001 R-squared = > 0.7668 Root MSE = > 51.549 (Std. err. adjusted for 10 clusters > in firm) ---------------------------------------------------------------------- > -------- | Robust inv_dot | Coefficient std. err. t P>|t| [95% conf. i > nterval] -------------+-------------------------------------------------------- > -------- value_dot | .1101238 .0151945 7.25 0.000 .0757515 > .1444961 capital_dot | .3100653 .0527518 5.88 0.000 .1907325 > .4293981 _cons | -7.49e-08 1.74e-06 -0.04 0.967 -4.00e-06 > 3.85e-06 ----------------------------------------------------------------------
Code:
. xtreg inv value capital, fe vce(cl firm) Fixed-effects (within) regression Number of obs = > 200 Group variable: firm Number of groups = > 10 R-squared: Obs per group: Within = 0.7668 min = > 20 Between = 0.8194 avg = > 20.0 Overall = 0.8060 max = > 20 F(2, 9) = > 28.31 corr(u_i, Xb) = -0.1517 Prob > F = > 0.0001 (Std. err. adjusted for 10 clusters > in firm) ---------------------------------------------------------------------- > -------- | Robust inv | Coefficient std. err. t P>|t| [95% conf. i > nterval] -------------+-------------------------------------------------------- > -------- value | .1101238 .0151945 7.25 0.000 .0757515 > .1444961 capital | .3100653 .0527518 5.88 0.000 .1907325 > .4293981 _cons | -58.74394 27.60286 -2.13 0.062 -121.186 > 3.698079 -------------+-------------------------------------------------------- > -------- sigma_u | 85.732502 sigma_e | 52.767966 rho | .72525011 (fraction of variance due to u_i) ----------------------------------------------------------------------
Comment