jfox at mcmaster.ca
Wed Dec 29 22:42:22 CET 2004
I'm not sure that I'm interpreting your question properly, but I'll give it
a shot: When you use a two-level factor as the response variable in a
binomial GLM, the first level is taken to represent "failure" and the second
"success." See ?glm for details. The default order of levels is
alphabetical, so unless you did something to order the levels differently,
"Male" would correspond to success and "Female" to failure. Thus the fitted
probability would be the probability of "Male."
Is that what you wanted to know?
Department of Sociology
Canada L8S 4M4
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Rajdeep Das
> Sent: Wednesday, December 29, 2004 1:33 PM
> To: R Help Mailing List
> Subject: [R] predict.glm
> Hi All,
> Sorry for this is a very naive question.
> I am trying to do binary classification (male vs female)
> using glm using following data:
> X1 X2 X3 Class
> 2.3 4.5 2.1 Male
> 0.9 3.2 1.6 Male
> 1.7 1.8 2.6 Feamle
> I am trying to use predict.glm for prediction with
> type="respose" which gives the predicted probabilities as per
> My question is: which of the two classes does this
> probability corresponds to? My understanding is that it is
> the probability of the class that each of the new data has.
> Is that correct?
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide!
More information about the R-help