Dear all,
I am trying to run a quadratic regression with the first-difference of the explanatory variable but depending on the syntax, I get very different results;
The regression results are very different - what am I doing wrong?
I would like to use the second method as my goal is to produce a marginsplot.
Any help will be greatly appreciated. Thank you.
Sincerely,
Chiara
I am trying to run a quadratic regression with the first-difference of the explanatory variable but depending on the syntax, I get very different results;
Code:
use http://www.stata-press.com/data/r9/grunfeld.dta xtset company year * Attempt 1 - generate first-difference term and the squared first-difference term gen d_kstock=D.kstock gen kstocksq = kstock^2 gen d_kstocksq=D.kstocksq xtreg mvalue i.year d_kstock d_kstocksq, fe * Attempt 2 - preferred method using interaction operator xtreg mvalue i.year c.d_kstock##c.d_kstock, fe
I would like to use the second method as my goal is to produce a marginsplot.
Any help will be greatly appreciated. Thank you.
Sincerely,
Chiara
Comment