0
$\begingroup$

When I fit a logistic model in r, how do I know which probability the function gives me? I know it is supposed to be the "success probability", but which probability is that?

$\endgroup$

1 Answer 1

1
$\begingroup$

If your outcome is a 0/1 variable, it gives the probability of 1. If your outcome is a factor variable, it gives the probability of levels(y)[2] where y is the outcome. If you're confused, change your outcome to be a 0/1 variable where you control which values correspond to 0 and 1. For example, if your outcome y had two levels A and B and you wanted the fitted values to be the probability of B, you could run

glm((y=="B") ~ X)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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