Hello, have panel data of 171 countries from 1996-2019, and "https://www.statalist.org/forums/forum/general-stata-discussion/general/1675380-graph-for-evolution-variable-in-panel-form" is part of my data, and my baseline model is :
which
is dummy variables that get 1 in the time of recession and 0 otherwise, which is a shock in my model.
and "ltotalfertility" is the log of fertility rate
I wonder to see the analysis for advanced vs non-advanced with the interaction of the shock with a dummy – for total fertility rate, so first of all I generate the dummy variable "ae"=1 of an advanced economy and 0 otherwise.
and for the non-advanced also generate the non_adv=1 if non-advanced and 0 otherwise.
now Y=a+b1*x(1-adv) + b2*adv,
but in my regression when I add the interaction term, I did :
I received an error that
but when I estimate in the simple regression : xtscc d0ltotalfertility l(0/2).pand_res_pt l(0/2).pand_res_pt l(1/1)d0ltotalfertility i.year if ae==1 ,fe
I get the results:
, I hope I could receive your advice and assistance so soon on how can I do the interaction in the model without generating manually before on the regression,
many thanks in advance for your valuable time and advice.
Best regards,
Code:
xtscc d0ltotalfertility l(0/2).pand_res_pt#(1-ae) l(0/2).pand_res_pt#non-ae l(1/1)d0ltotalfertility i.year,fe
Code:
pand_res_pt
and "ltotalfertility" is the log of fertility rate
I wonder to see the analysis for advanced vs non-advanced with the interaction of the shock with a dummy – for total fertility rate, so first of all I generate the dummy variable "ae"=1 of an advanced economy and 0 otherwise.
and for the non-advanced also generate the non_adv=1 if non-advanced and 0 otherwise.
now Y=a+b1*x(1-adv) + b2*adv,
but in my regression when I add the interaction term, I did :
Code:
xtscc d0ltotalfertility l(0/2).pand_res_pt#(1-ae) l(0/2).pand_res_pt#ae l(1/1)d0ltotalfertility i.year,fe
1 invalid name
r(198);
r(198);
but when I estimate in the simple regression : xtscc d0ltotalfertility l(0/2).pand_res_pt l(0/2).pand_res_pt l(1/1)d0ltotalfertility i.year if ae==1 ,fe
I get the results:
Code:
xtscc d0ltotalfertility l(0/2).pand_res_pt l(1/1)d0ltotalfertility i.year if ae==1,fe
Regression with Driscoll-Kraay standard errors Number of obs = 480
Method: Fixed-effects regression Number of groups = 24
Group variable (i): ifscode F( 23, 19) = 4.36
maximum lag: 2 Prob > F = 0.0009
within R-squared = 0.2858
-----------------------------------------------------------------------------------
| Drisc/Kraay
d0ltotalfertility | Coefficient std. err. t P>|t| [95% conf. interval]
------------------+----------------------------------------------------------------
pand_res_pt |
--. | -.0118819 .0101403 -1.17 0.256 -.0331058 .0093421
L1. | -.0082734 .0045952 -1.80 0.088 -.0178913 .0013446
L2. | -.0246423 .0090083 -2.74 0.013 -.043497 -.0057877
|
d0ltotalfertility |
L1. | .0418261 .0946173 0.44 0.663 -.1562101 .2398624
|
year |
1996 | 0 (empty)
1997 | 0 (omitted)
1998 | .0111177 .0003693 30.10 0.000 .0103447 .0118907
1999 | .0258679 .0010344 25.01 0.000 .0237028 .028033
2000 | .0422096 .0003334 126.62 0.000 .0415119 .0429074
2001 | .002944 .0019368 1.52 0.145 -.0011097 .0069977
2002 | .025964 .0017114 15.17 0.000 .0223821 .029546
2003 | .0301912 .0005511 54.78 0.000 .0290377 .0313447
2004 | .0344751 .000893 38.61 0.000 .0326061 .0363441
2005 | .0273988 .0011047 24.80 0.000 .0250867 .029711
2006 | .0459436 .0004741 96.91 0.000 .0449513 .0469359
2007 | .0372346 .002296 16.22 0.000 .0324291 .0420402
2008 | .0440433 .0015482 28.45 0.000 .040803 .0472836
2009 | .0220309 .0085197 2.59 0.018 .0041991 .0398628
2010 | .0364267 .0031583 11.53 0.000 .0298164 .0430371
2011 | .0287997 .006892 4.18 0.001 .0143746 .0432247
2012 | .0251388 .0016314 15.41 0.000 .0217242 .0285534
2013 | -.0046172 .0006605 -6.99 0.000 -.0059997 -.0032346
2014 | .0349674 .0031627 11.06 0.000 .0283479 .041587
2015 | .0220649 .000931 23.70 0.000 .0201162 .0240136
2016 | .0229065 .0003692 62.04 0.000 .0221337 .0236792
2017 | 0 (omitted)
2018 | 0 (omitted)
2019 | 0 (omitted)
|
_cons | -.023716 .0001806 -131.34 0.000 -.0240939 -.023338
-----------------------------------------------------------------------------------
, I hope I could receive your advice and assistance so soon on how can I do the interaction in the model without generating manually before on the regression,
many thanks in advance for your valuable time and advice.
Best regards,

Comment