I am using STATA 16.1 and trying to estimate the following household (hhid) model.
reg D.y peak D.x peak#D.x
(I actually run reg diff_y peak diff_x peak_diff_x, where, diff_y is D.y and alike, and peak_diff_x is peak*diff_x , peak is dummy, as D. operator is not allowed with factor variable I have to run this way.)
I want to calculate the effect of D.x in peak (agricultural season) by adding coefficient of D.x and peak#D.x
However, it seems to me STATA is giving me wrong first difference for my purpose for seasonal data.
Please let me know where I go wrong?
I got the following first difference as
xtset hhid wave
gen diff_y = D.y
gen diff_x= D.x
input int hhid float wave byte peak float(y diff_y x diff_x)
2 1 0 2.6390574 . 1.568616 .
2 1 1 2.833213 . 1.568616 .
2 2 0 4.0943446 1.2611313 1.609438 .04082203
2 2 1 4.477337 1.6441236 1.609438 .04082203
2 3 0 5.252274 .7749367 1.609438 0
2 3 1 6.042633 1.565296 1.609438 0
3 1 0 4.4426513 . 1.0296195 .
3 1 1 5.105946 . 1.0296195 .
3 2 0 3.583519 -1.5224266 1.0986123 .06899285
3 2 1 4.158883 -.9470625 1.0986123 .06899285
3 3 0 4.553877 .3949938 1.0986123 0
3 3 1 5.631212 1.4723287 1.0986123 0
Related Posts with First differencing in Seasonal Agriculture Data
Esttab : combining regressorsI am trying to create an esttab output similar to this: Array my code is as follows: Code: eststo…
just tallying my results Survey: Probit regression Number of strata = 3 Number of obs = 527 Number of PSUs = 19 Popula…
Combine String ObservationsHello Stata-Users, I'm very new to stata and I've looked for this problem but seem to find only the…
Epxorting data to excelCan I export data to excel including variable name in the first row and label in the second row, and…
How to setup ONE STEP SYSTEM GMMHello, can someone explain how to set up the ONE STEP SYSTEM GMM in the Dynamic Panel choice in STAT…
Subscribe to:
Post Comments (Atom)
0 Response to First differencing in Seasonal Agriculture Data
Post a Comment