Displaying 20 results from an estimated 40000 matches similar to: "why does glm.predict give values over 1 ?"
2010 Feb 18
1
logistic regression - what is being predicted when using predict - probabilities or odds?
Dear gurus,
I've analyzed a (fake) data set ("data") using logistic regression (glm):
logreg1 <- glm(z ~ x1 + x2 + y, data=data, family=binomial("logit"),
na.action=na.pass)
Then, I created a data frame with 2 fixed levels (0 and 1) for each predictor:
attach(data)
x1<-c(0,1)
x2<-c(0,1)
y<-c(0,1)
newdata1<-data.frame(expand.grid(x1,x2,y))
2004 Sep 22
5
Issue with predict() for glm models
[This email is either empty or too large to be displayed at this time]
2012 Jan 15
1
Need help interpreting the logit regression function
Hello R community,
I have a question about the logistic regression function.
Specifically, when the predictor variable has not just 0's and 1's,
but also fractional values (between zero and one). I get a warning
when I use the "glm(formula = ... , family = binomial(link =
"logit"))" which says:
"In eval(expr, envir, enclos) : non-integer #successes in a binomial
2009 Mar 09
1
predict.glm predicted prob above 1?
I have a puzzle....
When I include an interaction in the model, many predicted probabilities are above 1. Is that a problem with my model? I thought the predicted prob can't be bigger than 1...
Any help would be really appreciated! Thanks!
K.
reg1<-glm(pyea~male+edu+married+inc+relig+factor(time)+
factor(time)*male, data=mydata, family=binomial(link="logit"))
2010 Sep 23
2
Prediction plot for logistic regression output
How do I construct a figure showing predicted value plots for the dependent variable as a function of each explanatory variable (separately) using the results of a logistic regression? It would also be helpful to know how to show uncertainty in the prediction (95% CI or SE).
Thanks-
This email has been processed by SmoothZap - www.smoothwall.net
2010 Dec 25
2
predict.lrm vs. predict.glm (with newdata)
Hi all
I have run into a case where I don't understand why predict.lrm and
predict.glm don't yield the same results. My data look like this:
set.seed(1)
library(Design); ilogit <- function(x) { 1/(1+exp(-x)) }
ORDER <- factor(sample(c("mc-sc", "sc-mc"), 403, TRUE))
CONJ <- factor(sample(c("als", "bevor", "nachdem",
2004 Dec 29
1
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 documentation.
My
2012 Mar 19
1
glm: getting the confidence interval for an Odds Ratio, when using predict()
Say I fit a logistic model and want to calculate an odds ratio between 2
sets of predictors. It is easy to obtain the difference in the predicted
logodds using the predict() function, and thus get a point-estimate OR. But
I can't see how to obtain the confidence interval for such an OR.
For example:
model <- glm(chd ~age.cat + male + lowed, family=binomial(logit))
pred1 <-
2012 Dec 12
2
help with predict.glm, and charting with factors
Dear R Wizards,
After much frustration and days of confusion I have finally broken down and
am asking for help, which I don’t like doing, but I just can’t figure this
one out on my own. I’ve conducted a laboratory experiment testing the
effects of temperature and salinity on whether or not a biological event
will occur (Go or NoGo). I’ve coded the factors temperature and salinity
as factors for
2008 Mar 21
1
warning message in a glm model
Se ha borrado un texto insertado con un juego de caracteres sin especificar...
Nombre: no disponible
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20080321/71b93d3d/attachment.pl
2008 May 28
1
confidence interval for the logit - predict.glm
Hello all,
I've come across an online posting
http://www.biostat.wustl.edu/archives/html/s-news/2001-10/msg00119.html
that described how to get confidence intervals for predicted values from predict.glm. These instructions were meant for S-Plus. Yet, it generally seems to work with R too, but I am encountering some problems. I am explaining my procedure in the following and would be most
2011 Sep 21
1
Problem with predict and lines in plotting binomial glm
Problems with predict and lines in plotting binomial glm
Dear R-helpers
I have found quite a lot of tips on how to work with glm through this mailing list, but still have a problem that I can't solve.
I have got a data set of which the x-variable is count data and the y-variable is proportional data, and I want to know what the relationship between the variables are.
The data was
2006 Jan 18
4
negative predicted values in poisson glm
Dear R helpers,
running the following code of a glm model of the family poisson, gives
predicted values < 0. Why?
library(MASS)
library(stats)
library(mvtnorm)
library(pscl)
data(bioChemists)
poisson_glm <- glm(art ~ fem + mar + kid5 + phd + ment, data = bioChemists,
family = poisson)
predicted.values = predict(poisson_glm)
range(predicted.values)
Thank you in advance for any hints.
2009 Jul 10
2
predict.glm -> which class does it predict?
Hi,
I have a question about logistic regression in R.
Suppose I have a small list of proteins P1, P2, P3 that predict a
two-class target T, say cancer/noncancer. Lets further say I know that I
can build a simple logistic regression model in R
model <- glm(T ~ ., data=d.f(Y), family=binomial) (Y is the dataset of
the Proteins).
This works fine. T is a factored vector with levels cancer,
2011 Aug 26
2
How to find the accuracy of the predicted glm model with family = binomial (link = logit)
Hi All,
When modeling with glm and family = binomial (link = logit) and response values of 0 and 1, I get the predicted probabilities of assigning to my class one, then I would like to compare it with my vector y which does have the original labels. How should I change the probabilities into values of zero and 1 and then compare it with my vector y to find out about the accuracy of my
2011 Jan 27
2
Extrapolating values from a glm fit
Dear R-help,
I have fitted a glm logistic function to dichotomous forced choices
responses varying according to time interval between two stimulus. x values
are time separation in miliseconds, and the y values are proportion
responses for one of the stimulus. Now I am trying to extrapolate x values
for the y value (proportion) at .25, .5, and .75. I have tried several
predict parameters, and they
2012 Dec 11
1
glm - predict logistic regression - entering the betas manually.
Dear All,
I know this may be a trivial question.
In the past I have used glm to make logistic regressions on data. The output creates an object with the results of the logistic regression. This object can then be used to make predictions.
Great.
I have a different problem. I need to make predictions from a logistic regression taken from a paper. Thus I need to (by hand) enter the reported odds
2008 May 06
1
question about se of predicted glm values
Hey, all. I had a quick question about fitting new glm values and
then looking at the error around them. I'm working with a glm using a
Gamma distribution and a log link with two types of treatments.
However, when I then look at the predicted values for each category, I
find for the one that is close to 0, the error (using se.fit=T with
predicted) actually makes it overlap 0.
2007 Oct 02
1
problems with glm
I am having a couple of problems someone may be able to cast some light on.
Question 1:
I am making a logistic model but when i do this:
glm.model = glm(as.factor(form$finished) ~ ., family=binomial,
data=form[1:150000,])
I get this:
Error in model.frame(formula, rownames, variables, varnames, extras,
extranames, :
variable lengths differ (found for 'barrier')
which is
2000 Feb 17
3
se from predict.glm
I am not sure whether it is a design decision or just an oversight.
When I ask for the standard errors of the predictions with
predict(budwm.lgt,se=TRUE)
where budwm.lgt is a logistic fit of the budworm data in MASS, I got
Error in match.arg(type) : ARG should be one of response, terms
If one is to construct a CI for the fitted binomial probability,
wouldn't it be more natural to do