Hi,
I am having some problems to understand how Stata handles interaction terms between a continuous variable and a categorical variables with quantile regression qreg.
My model looks like:
Yi=B0 + B1*D1i + B2*D2i + B3*D3i + B4*D1i*Xi + B5*D2i*Xi + B6*D3i*Xi + Ei i=1..n;
Where Betas are the coefficients, D1, D2, D3 are three binary variables such that D1i+D2i+D3i=1 for every i and Xi is the continuous variable.
If I run the previous model with regress y i.D c.X#i.D
Stata drops the first binary variable, D1, and it estimates all the other coefficients, in particular B4, B5, and B6. If I remember correctly, this is possible because there is not perfect collinearity between the intercept and the sum of the three interacted effects, that is D1i*Xi + D2i*Xi + D3i*Xi.
However, when I run xi: qreg y i.D c.X#i.D
1) Stata drops the first interacted term, that is D1i*Xi:
2) Stata estimates the second interacted term, that is D2i*Xi, in every state. In other words, Stata estimates two different coefficients for D2i*Xi, one when D2i=0 and one when D2i=1.
3) Stata estimates the third interacted term, that is D3i*Xi, when D3i=0 and omits the case when D3i=1.
Any help would be greatly appreciated.
Simone
I am having some problems to understand how Stata handles interaction terms between a continuous variable and a categorical variables with quantile regression qreg.
My model looks like:
Yi=B0 + B1*D1i + B2*D2i + B3*D3i + B4*D1i*Xi + B5*D2i*Xi + B6*D3i*Xi + Ei i=1..n;
Where Betas are the coefficients, D1, D2, D3 are three binary variables such that D1i+D2i+D3i=1 for every i and Xi is the continuous variable.
If I run the previous model with regress y i.D c.X#i.D
Stata drops the first binary variable, D1, and it estimates all the other coefficients, in particular B4, B5, and B6. If I remember correctly, this is possible because there is not perfect collinearity between the intercept and the sum of the three interacted effects, that is D1i*Xi + D2i*Xi + D3i*Xi.
However, when I run xi: qreg y i.D c.X#i.D
1) Stata drops the first interacted term, that is D1i*Xi:
2) Stata estimates the second interacted term, that is D2i*Xi, in every state. In other words, Stata estimates two different coefficients for D2i*Xi, one when D2i=0 and one when D2i=1.
3) Stata estimates the third interacted term, that is D3i*Xi, when D3i=0 and omits the case when D3i=1.
Any help would be greatly appreciated.
Simone
Comment