Stata handles factor (categorical) variables elegantly.
You can prefix a variable with i. to specify indicators for each level (category) of the variable.
You can put a # between two variables to create an interaction–indicators for each combination of the categories of the variables. You can put ## instead to specify a full factorial of the variables—main effects for each variable and an interaction.
If you want to interact a continuous variable with a factor variable, just prefix the continuous variable with c..
You can specify up to eight-way interactions.


雷达卡

京公网安备 11010802022788号







