Hi, This is a newbie question. I have been using glm to perform some logistic regression. However, if I take the fitted parameters (as part of the glm object) and pass them on the glm.predict function, for some test cases I am getting predicted values that are a little over 1. This is a bit puzzling for me, because my understanding was that these numbers are probabilities and so should be between 0 and 1. Thanks a lot! I'd appreciate any help you could provide. -rohit
If you left the type argument to the predict method then your predictions are on the log-odds scale. Try using the type='response' in the predict method for glm. --Matt> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Rohit Singh > Sent: Monday, October 31, 2005 2:52 PM > To: r-help at stat.math.ethz.ch > Subject: [R] why does glm.predict give values over 1 ? > > > Hi, > > This is a newbie question. I have been using glm to perform > some logistic > regression. However, if I take the fitted parameters (as part > of the glm > object) and pass them on the glm.predict function, for some > test cases I > am getting predicted values that are a little over 1. This is a bit > puzzling for me, because my understanding was that these numbers are > probabilities and so should be between 0 and 1. > > > Thanks a lot! I'd appreciate any help you could provide. > > -rohit > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
On 31-Oct-05 Rohit Singh wrote:> Hi, > > This is a newbie question. I have been using glm to perform some > logistic regression. However, if I take the fitted parameters (as > part of the glm object) and pass them on the glm.predict function, > for some test cases I am getting predicted values that are a little > over 1. This is a bit puzzling for me, because my understanding > was that these numbers are probabilities and so should be between > 0 and 1. > > Thanks a lot! I'd appreciate any help you could provide. > > -rohitIndeed this should not happen, and probably there is some mistake in the way you use the predict function (which requires a little care). However, it's not possible to point-point what is happening without seeing a specific case. Can you post an example of the code you use when this happens? And, if feasible, also an example of data. Best wishes, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 31-Oct-05 Time: 23:00:39 ------------------------------ XFMail ------------------------------
Maybe Matching Threads
- logistic regression - what is being predicted when using predict - probabilities or odds?
- Issue with predict() for glm models
- Need help interpreting the logit regression function
- predict.glm predicted prob above 1?
- Prediction plot for logistic regression output