Hi,
I am estimating the following linear regression - this is just a dummy for China interacted with time dummies, plus the same for a Hong Kong dummy
This is the output:
As you can see, I am also calculating the marginal effects for each time period - in this case they are just the coefficient on China + the interaction term with China for each coefficient. (likewise for Hong Kong)
Even though my regression output does give me estimated coefficients for all interactions and intercepts, the margins command says that everything is not estimable:
Can you help me figure out why, please?
I am estimating the following linear regression - this is just a dummy for China interacted with time dummies, plus the same for a Hong Kong dummy
Code:
reghdfe unit_value i.china_dummy##i.year i.hk_dummy##i.year, absorb(hs8_group##ym state_group) vce(robust)
Code:
. reghdfe unit_value i.china_dummy##i.year i.hk_dummy##i.year, absorb(hs8_group##ym state_group) vce(robust) (dropped 73 singleton observations) (MWFE estimator converged in 7 iterations) note: 2013bn.year is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09) note: 2014bn.year is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09) note: 2015bn.year is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09) note: 2016bn.year is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09) note: 2017bn.year is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09) note: 2018bn.year is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09) note: 2019bn.year is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09) note: 2020bn.year is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09) note: 2021bn.year is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09) note: 2022bn.year is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09) HDFE Linear regression Number of obs = 130,799 Absorbing 2 HDFE groups F( 22, 129253) = 21.19 Prob > F = 0.0000 R-squared = 0.2008 Adj R-squared = 0.1912 Within R-sq. = 0.0006 Root MSE = 3.5441 ---------------------------------------------------------------------------------- | Robust unit_value | Coefficient std. err. t P>|t| [95% conf. interval] -----------------+---------------------------------------------------------------- 1.china_dummy | -.493448 .1374035 -3.59 0.000 -.7627565 -.2241395 | year | 2013 | 0 (omitted) 2014 | 0 (omitted) 2015 | 0 (omitted) 2016 | 0 (omitted) 2017 | 0 (omitted) 2018 | 0 (omitted) 2019 | 0 (omitted) 2020 | 0 (omitted) 2021 | 0 (omitted) 2022 | 0 (omitted) | china_dummy#year | 1 2013 | .7311467 .3358236 2.18 0.029 .0729384 1.389355 1 2014 | .7689996 .443334 1.73 0.083 -.0999272 1.637926 1 2015 | .8111661 .1675883 4.84 0.000 .482696 1.139636 1 2016 | .560081 .1590176 3.52 0.000 .2484093 .8717527 1 2017 | .4758682 .1577632 3.02 0.003 .166655 .7850813 1 2018 | .8301727 .1627107 5.10 0.000 .5112626 1.149083 1 2019 | .866174 .1661845 5.21 0.000 .5404552 1.191893 1 2020 | .6821976 .1717615 3.97 0.000 .345548 1.018847 1 2021 | .7371718 .1756435 4.20 0.000 .3929136 1.08143 1 2022 | .2713062 .2159342 1.26 0.209 -.1519211 .6945334 | 1.hk_dummy | .0622282 .0493742 1.26 0.208 -.0345443 .1590007 | hk_dummy#year | 1 2013 | .4297135 .0622894 6.90 0.000 .3076274 .5517997 1 2014 | .3260669 .0652209 5.00 0.000 .198235 .4538987 1 2015 | .0318809 .0638135 0.50 0.617 -.0931924 .1569543 1 2016 | .0770146 .0625716 1.23 0.218 -.0456247 .1996538 1 2017 | -.0555324 .0649348 -0.86 0.392 -.1828035 .0717387 1 2018 | .027625 .0657469 0.42 0.674 -.1012377 .1564876 1 2019 | -.2082516 .0677319 -3.07 0.002 -.341005 -.0754983 1 2020 | -.3769615 .0644718 -5.85 0.000 -.503325 -.250598 1 2021 | -.3950385 .0692449 -5.70 0.000 -.5307573 -.2593197 1 2022 | -.3629789 .0930993 -3.90 0.000 -.5454518 -.180506 | _cons | 4.576375 .0106752 428.69 0.000 4.555452 4.597298 ---------------------------------------------------------------------------------- Absorbed degrees of freedom: --------------------------------------------------------+ Absorbed FE | Categories - Redundant = Num. Coefs | ----------------+---------------------------------------| hs8_group#ym | 1500 0 1500 | state_group | 25 1 24 | --------------------------------------------------------+ . end of do-file
Code:
margins 1.china_dummy 1.hk_dummy, dydx(i.year)
Code:
Average marginal effects Number of obs = 130,799 Model VCE: Robust Expression: Linear prediction, predict() dy/dx wrt: 2013.year 2014.year 2015.year 2016.year 2017.year 2018.year 2019.year 2020.year 2021.year 2022.year ------------------------------------------------------------------------------- | Delta-method | dy/dx std. err. z P>|z| [95% conf. interval] --------------+---------------------------------------------------------------- 2012.year | (base outcome) --------------+---------------------------------------------------------------- 2013.year | 1.china_dummy | . (not estimable) 1.hk_dummy | . (not estimable) --------------+---------------------------------------------------------------- 2014.year | 1.china_dummy | . (not estimable) 1.hk_dummy | . (not estimable) --------------+---------------------------------------------------------------- 2015.year | 1.china_dummy | . (not estimable) 1.hk_dummy | . (not estimable) --------------+---------------------------------------------------------------- 2016.year | 1.china_dummy | . (not estimable) 1.hk_dummy | . (not estimable) --------------+---------------------------------------------------------------- 2017.year | 1.china_dummy | . (not estimable) 1.hk_dummy | . (not estimable) --------------+---------------------------------------------------------------- 2018.year | 1.china_dummy | . (not estimable) 1.hk_dummy | . (not estimable) --------------+---------------------------------------------------------------- 2019.year | 1.china_dummy | . (not estimable) 1.hk_dummy | . (not estimable) --------------+---------------------------------------------------------------- 2020.year | 1.china_dummy | . (not estimable) 1.hk_dummy | . (not estimable) --------------+---------------------------------------------------------------- 2021.year | 1.china_dummy | . (not estimable) 1.hk_dummy | . (not estimable) --------------+---------------------------------------------------------------- 2022.year | 1.china_dummy | . (not estimable) 1.hk_dummy | . (not estimable) ------------------------------------------------------------------------------- Note: dy/dx for factor levels is the discrete change from the base level. . end of do-file
Comment