Hello,
I'm getting different coefficients when I manually create an interaction term versus when I use the # command on stata, and I am not sure why.
I replicated a simple version of my code using auto.dta for ease of replicability. Thanks for any help in advance!
Code:
sysuse auto.dta, clear
gen dummy = headroom<3
gen dummyinteract = dummy*headroom
reg price dummy dummy#c.headroom
reg price dummy dummyinteract
Edit: Should add, I'm using Stata 16.1 on a firewalled server
I'm getting different coefficients when I manually create an interaction term versus when I use the # command on stata, and I am not sure why.
I replicated a simple version of my code using auto.dta for ease of replicability. Thanks for any help in advance!
Code:
sysuse auto.dta, clear
gen dummy = headroom<3
gen dummyinteract = dummy*headroom
reg price dummy dummy#c.headroom
reg price dummy dummyinteract
Edit: Should add, I'm using Stata 16.1 on a firewalled server
Comment