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?
1 Answer
$\begingroup$
$\endgroup$
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)