1
$\begingroup$

I've run a logistic regression on two binary 0,1 variables. One is "seizure yes, no" the other is "sex, male, female".

Now if I run a margins command on these variables, I get a number as a result. I don't quite understand this number despite looking around what exactly it means. It seems it means a probability.

Does this mean that I have the computed probability of getting a seizure if you are a male and if you are female?

Also, can I somehow use the margins command for my entire multiple regression model, computing the probability given you are male but in the model instead of by itself?

$\endgroup$
  • $\begingroup$ Can you please add the exact margins command including any options? The margins command can do multiple things. $\endgroup$ – Matt P Apr 22 at 13:18
  • $\begingroup$ margins sex, after running a logistic regression. $\endgroup$ – Paze Apr 22 at 13:26
2
$\begingroup$

The command :margins sex" computes the "average adjusted prediction" for men and women. That is, the prediction for men is calculated by plugging the values from every observation into the logit model you already estimated but with sex=male for everyone, then taking the average of the predicted dependent variable. You can think of this as what the average probability of a seizure would be in your study if everyone were male (according to your logit model).

$\endgroup$
  • $\begingroup$ 'You can think of this as what the average probability of a seizure would be in your study if everyone were male (according to your logit model).' Is this drastically different than saying "It computes the probability of being male and having a seizure, based on your model"? $\endgroup$ – Paze Apr 22 at 13:53
  • $\begingroup$ It is one way of answering the question "what is the probability of having a seizure if you are male based on your model." There are other possible ways to answer that question. For example, you could use the atmeans option which will use the average values of other variables and set sex=male. $\endgroup$ – Matt P Apr 22 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.