Hi Clyde,
Sorry to bother you yesterday with simple questions about collinearity. I've made the level of my analysis more simple with the hope of making sure I'm calculating margins (the original topic of this thread) correctly. The motivation for the regression is that I'd like to use it to calculate predicted values for each state if all RHS covariates are set at the global means. I'd think the following code would accomplish that:
However, I still have one election_cycle#state_code combination that is collinear and drops. So I thought I'd look at just one state and two years to make sure I am calculating margins as I'd like it to. When I do this, however, I am unable to produce estimates. There's no collinearity, no empty combinations, and an F-stat is reported, so I'm not sure why this is happening. Do you have an idea why? Thanks!
Sorry to bother you yesterday with simple questions about collinearity. I've made the level of my analysis more simple with the hope of making sure I'm calculating margins (the original topic of this thread) correctly. The motivation for the regression is that I'd like to use it to calculate predicted values for each state if all RHS covariates are set at the global means. I'd think the following code would accomplish that:
Code:
reg deflator_temp c.win_margin unopposed senate president governor i.non_presidential_year i.non_senate_year i.non_gubernatorial_year i.election_cycle#i.state_code, r noconstant margins state_code#election_cycle, atmeans
Code:
keep if year>2008 (2794 observations deleted) . keep if state_code==5 (919 observations deleted) . reg deflator_temp c.win_margin unopposed senate president governor i.non_presidential_year i.ele > ction_cycle, noconstant Source | SS df MS Number of obs = 110 -------------+------------------------------ F( 7, 103) = 312.91 Model | 26.303232 7 3.75760458 Prob > F = 0.0000 Residual | 1.23690088 103 .012008746 R-squared = 0.9551 -------------+------------------------------ Adj R-squared = 0.9520 Total | 27.5401329 110 .250364845 Root MSE = .10958 ----------------------------------------------------------------------------------------- deflator_temp | Coef. Std. Err. t P>|t| [95% Conf. Interval] ------------------------+---------------------------------------------------------------- win_margin | .0808634 .0586245 1.38 0.171 -.0354045 .1971313 unopposed | -.1483611 .0881765 -1.68 0.095 -.3232385 .0265162 senate | .0091408 .0786012 0.12 0.908 -.1467461 .1650277 president | .006913 .1106506 0.06 0.950 -.2125364 .2263623 governor | .0342378 .111239 0.31 0.759 -.1863786 .2548542 1.non_presidential_year | .3957682 .0244157 16.21 0.000 .3473454 .444191 17.election_cycle | .5264039 .0224857 23.41 0.000 .4818089 .570999 ----------------------------------------------------------------------------------------- . margins election_cycle, atmeans Adjusted predictions Number of obs = 110 Model VCE : OLS Expression : Linear prediction, predict() at : win_margin = .3129933 (mean) unopposed = .0181818 (mean) senate = .0181818 (mean) president = .0090909 (mean) governor = .0090909 (mean) 0.non_pres~r = .5 (mean) 1.non_pres~r = .5 (mean) 16.electio~e = .5 (mean) 17.electio~e = .5 (mean) -------------------------------------------------------------------------------- | Delta-method | Margin Std. Err. t P>|t| [95% Conf. Interval] ---------------+---------------------------------------------------------------- election_cycle | 16 | . (not estimable) 17 | . (not estimable) --------------------------------------------------------------------------------
Comment