Suppose, I have three variables: An outcome, a dummy variable D=0,1, and a variable with three values E=1,2,3.
I want to estimate the following interacted model (without constant):
Code:
gen E1 = E == 1 gen E2 = E == 2 gen E3 = E == 3 gen D_E1 = E1 * D gen D_E2 = E2 * D gen D_E3 = E3 * D reg Y E1 E2 E3 D_E1 D_E2 D_E3, nocons
Code:
reg Y i.E##i.D, nocons,
Thank you so much!
0 Response to factor variables and interactions
Post a Comment