For high SES students, treatment increases the predicted probability of graduation from about. Now, if you plug those probabilities into the formula for calculating the odds ratio, you will find that the odds ratio is 2. Treatment adds the same amount to the linear function that is passed through the logistic function in both cases. But recall the shape of the logistic function:. The treatment has a much smaller effect on the probability of graduation for high SES students because their probability is already very high—it can't get much higher.
Low SES students are in the part of the logistic curve that slopes steeply, so changes in the linear function have much larger effects on the predicted probability. The margins command can most directly answer the question "Does the effect of the treatment vary with SE? You can also do this with margins highSES, dydx treat. Once again, these are the same numbers you'd get by subtracting the levels obtained above. We suggest always looking at levels as well as changes—knowing where the changes start from gives you a much better sense of what's going on.
It's a general rule that it's easiest to change the predicted probability for subjects who are "on the margin;" i. However, this is a property of the logistic function, not the data. It is an assumption you make when you choose to run a logit model. Multinomial logit models can be even harder to interpret because the coefficients only compare two states. Clear Stata's memory and load the following data set, which was carefully constructed to illustrate the pitfalls of interpreting multinomial logit results:.
It contains two variables, an integer y that takes on the values 1, 2 and 3; and a continuous variable x. They are negatively correlated cor y x. The coefficient of x for outcome 2 is negative, so it's tempting to say that as x increases the probability of y being 2 decreases. But in fact that's not the case, as the margins command will show you:.
The predict options allows you to choose the response margins is examining. And in fact the probability of outcome 2 increases with x , the derivative being 0.
How can that be? Recall that the coefficients given by mlogit only compare the probability of a given outcome with the base outcome. Thus the x coefficient of Meanwhile the x coefficient of What it doesn't tell you is that as x increases observations also move from outcome 3 to outcome 2, and in fact that effect dominates the movement from 2 to 1.
Now the coefficients tell you about the probability of each outcome compared to outcome 2, and the fact that the negative x coefficient for outcome 3 is much larger in absolute terms than the positive x coefficient for outcome 1 indicates that increasing x increases the probability of outcome 2. We strongly recommend using margins to explore what your regression results mean.
U niversity of W isconsin —Madison. Join the SSCC. Exploring Regression Results using Margins Once you've run a regression, the next challenge is to figure out what the results mean. It contains the following sections: OLS Regression With Non-Linear Terms Logistical Regression Multinomial Logit Sections 1 and 2 are taken directly from the Statistics section of Stata for Researchers they are reproduced here for the benefit of those looking specifically for information about using margins.
OLS Regression With Non-linear Terms The margins command can only be used after you've run a regression, and acts on the results of the most recent regression command. For our first example, load the auto data set that comes with Stata and run the following regression: sysuse auto reg price c. The values in the column headed Margin are the predicted probabilities for males and females while holding read at its mean.
Next, we will use margins to get the predicted probabilities for the values of read from 20 to 70 in increments of 10 while holding 1. We will also include the post option so that we can easily get the estimates and their standard errors.
We will also include the vsquish option to produce a more compact output. The variable 1. You can ignore the mean value for 0. The Margin column once again gives the predicted probability. This can also be replicated using the commands:. If we multiply the F-ratio for prog by the numerator degrees of freedom, we get a value scaled like a chi-square. We can run the same model using the anova command. The anova will appear to be somewhat different because the model is parameterized differently but it is the exact same model.
Note that the F-ratio for female prog is the same as that from the testparm command and that the F-ratio for honors read is the same as the t-value squared from the regression output -. Next, we will use estimates store to save this model before using margins with the post option. We are finally ready to use the margins command to look at the female prog interaction. In case you have difficulty determining what each of the lines in the output above refers to, you can retype the margins command with the coeflegend option for more information.
And, because we used the post option, we can use the test command to compare differences in adjusted cell means. The critical value of F for the per family error rate for these tests of simple main effects at alpha equals. Using 7. The test of prog at female equal one females was not significant. We should follow up on the significant test with pairwise comparisons at female equals zero. These tests do not include any adjustments for multiple comparisons but we can use a Bonferroni adjustment by dividing our alpha level by the number of pairwise tests.
Next, we can turn our attention to the significant categorical by continuous interaction, honors by read. If you look back at the regression output you will see that the coefficient for read was. This value,. We can easily obtain the slope when honors equals one by adding this coefficient to the coefficient for the interaction term. These results are indeed the same as our computation of the slopes above. Of course now we also have standard errors and confidence intervals for both slopes.
0コメント