Consider a simple logistic regression, followed by the margins command, and then marginsplot, as in this simple example (derived from an example in the manual section on logistic regression):
webuse nhanes2
logistic highbp sex##agegrp
margins sex##agegrp
marginsplot
The logistic command gives the results in terms of the odds ratio (OR), which is what I want.
However, the final marginsplot command plots the results using Pr(HighBP) on the y-axis, or the probability of highBP as a function of male and female, not the Odds Ratios and confidence limits that are output by the logistic command.
I want to plot the Odds ratios and confidence limits (rather than the probabilities, as is the default). It seems to me that this should be easily doable somehow by using the simple marginsplot command with some type of option, rather than having to create a new plot from scratch.
I have now spent many hours going through all the commands and options in the manuals and examples and was surprised that no method is to be found for doing this.
Perhaps I am missing something somewhere, it seems that many people would want to do this, and there has to be an easy way to do it.
I am an expert in statistics but am just getting familiar with the logistic methods in Stata, so perhaps I am missing something simple.
Please advise, thanks!
webuse nhanes2
logistic highbp sex##agegrp
margins sex##agegrp
marginsplot
The logistic command gives the results in terms of the odds ratio (OR), which is what I want.
However, the final marginsplot command plots the results using Pr(HighBP) on the y-axis, or the probability of highBP as a function of male and female, not the Odds Ratios and confidence limits that are output by the logistic command.
I want to plot the Odds ratios and confidence limits (rather than the probabilities, as is the default). It seems to me that this should be easily doable somehow by using the simple marginsplot command with some type of option, rather than having to create a new plot from scratch.
I have now spent many hours going through all the commands and options in the manuals and examples and was surprised that no method is to be found for doing this.
Perhaps I am missing something somewhere, it seems that many people would want to do this, and there has to be an easy way to do it.
I am an expert in statistics but am just getting familiar with the logistic methods in Stata, so perhaps I am missing something simple.
Please advise, thanks!
Comment