Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Time demean panel variables using -center command
From
Vaidyanathan Ganapathy <[email protected]>
To
[email protected]
Subject
st: Time demean panel variables using -center command
Date
Wed, 12 Mar 2014 00:07:03 -0700
Dear STATAlisters,
I have a panel data (id, time) and wondering what would be the best
method to demean the dependent variable, which is natural logarithm of
costs? I tried using the -center command by Ben Jann which produces
the demeaned variables case wise. Can we demean ln(dependent variable)
as it is, or should the dependent variable be first time demeaned
using original scale and then logarithm be applied?
I basically used the -center command to demean ln(costs) to use the
demeaned variables for regressions run on 2 separate groups (the goal
is to run separate fixed effects models for 2 groups and compare the
coefficients). However, when I compare coefficients of the variables
from the two regressions (i.e. take the difference), the results are
not meaningful. By not meaningful, I mean that the overall differences
in coefficients are too small or getting dropped out.
Is there something wrong with the approach of demeaning the dependent
variable - ln(costs), or is there something wrong in how the
differentials were calculated (I am using the Oaxaca decomposition
method to analyze differences between the coefficients)?
Below is what I ran and the corresponding outputs -
//De-mean the ln(dependent) and the indendent variables -
by pcn: center lnallhccx2 tpcat2-tpcat6 bpdx2 chdx2 asthbrdx2 cnsdx2
motordx2 physdevdx2 nddx2 chrnic1, casewise
//Run OLS regression with cluster robust errors of the dependent
variable on set of predictors for two groups (premie_cat=0 and
premie_cat==2)
oaxaca c_lnallhccx2 c_tpcat2- c_tpcat6 c_bpdx2 c_chdx2 c_asthbrdx2
c_cnsdx2 c_motordx2 c_physdevdx2 c_nddx2 c_chrnic1 c_period if
premie_cat==0|premie_cat==2, by(premie_cat) weight(0 1) cluster(pcn)
Blinder-Oaxaca decomposition Number of obs = 137972
1: premie_cat = 0
2: premie_cat = 2
(Std. Err. adjusted for 68994 clusters in pcn)
-------------------------------------------------------------------------------
| Robust
c_lnallhccx2 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
--------------+----------------------------------------------------------------
Differential |
Prediction_1 | 4.73e-10 6.22e-10 0.76 0.447 -7.46e-10 1.69e-09
Prediction_2 | 1.19e-08 9.81e-09 1.21 0.227 -7.36e-09 3.11e-08
Difference | -1.14e-08 9.83e-09 -1.16 0.247 -3.07e-08 7.88e-09
--------------+----------------------------------------------------------------
Decomposition |
Explained | 0 (omitted)
Unexplained | -1.14e-08 9.83e-09 -1.16 0.247 -3.07e-08 7.88e-09
-------------------------------------------------------------------------------
Thanks !
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/