This statement does the same thing as the first two statements. In the above line, enrolled is itself a dummy variable—a variable taking on values zero and one. Just as Stata returns 1 for true and 0 for false, Stata assumes that 1 means true and that 0 means false. If you type. It is also not necessary for the variable being tabulated to take sequential values or even be integers.
Here is another example:. You can find out what the values are from describe :. Finally, tabulate can be used with string variables:. Checkout Continue shopping. Stata: Data Analysis and Statistical Software. When you are generating indicator variables dummy variables, contrasts from a categorical variables like the continent variable, you need to omit one of the categories base or reference categories. In all regression examples below one of the continents will be omitted, i.
By default the first smallest value will be used as reference category; there is a ib operator to indicate other base values. As it turns out, by testing prog2 and prog3 together, we find that the variable program type is not statistically significant. We can also do this in one step using the i. Factor variables create indicator variables from categorical variables and are allowed with most estimation and postestimation commands Note how the results below match those above exactly.
As we did in the prior example, we can test the overall effect of program type with the test command as shown below. The contrast command can be used to get the multi-degree-of-freedom test of the categorical variable. Numeric Label 52 0 Domestic 22 1 Foreign. In Stata we can state something as true like below: use the dummy variable without explicitly specifying the condition but with the variable name alone.
One way to create a dummy variable is to use generate with an statement.
0コメント