Displaying 20 results from an estimated 4000 matches similar to: "Finding predicted probabilities and their confidence intervals for a logit model"
2012 Aug 13
3
Using the effects package to plot logit probabilities
I'm trying to run a logit model and plot the probability curve for a number
of the important predictors. I'm trying to do this
with the Effects package.
df=data.frame(income=c(5,5,3,3,6,5),
won=c(0,0,1,1,1,0),
age=c(18,18,23,50,19,39),
home=c(0,0,1,0,0,1))
str(df)
md1 = glm(factor(won) ~ income + age + home,
data=df,
2012 Jul 05
2
Plotting the probability curve from a logit model with 10 predictors
I have a logit model with about 10 predictors and I am trying to plot the
probability curve for the model.
Y=1 = 1 / 1+e^-z where z=B0 + B1X1 + ... + BnXi
If the model had only one predictor, I know to do something like below.
mod1 = glm(factor(won) ~ as.numeric(bid), data=mydat,
family=binomial(link="logit"))
all.x <- expand.grid(won=unique(won), bid=unique(bid))
y.hat.new
2012 Feb 09
1
Finding all the coefficients for a logit model
Let's say I have a variable, day, which is saved as a factor with 7 levels,
and I use it in a
logistic regression model. I ran the model using the car package in R and
printed out the
results.
mod1 = glm(factor(status1) ~ factor(day), data=mydat,
family=binomial(link="logit"))
print(summary(mod1))
The result I get is:
Coefficients:
Estimate Std. Error z value
2013 Feb 21
0
Odd Error message with rare events logit
I'm running a rare events logit model in R using the Zelig package and am
getting some of the oddest error messages that I can't figure out.
y = rnorm(100)
x = c(rep("0",1), rep("1",99))
d = data.frame(won=x, bid=y)
d
mod1 <- zelig(y~x, model="relogit", data=d, tau=1/100,
case.correct="prior", bias.correct=TRUE, robust=TRUE)
> mod1 <-
2012 Sep 11
1
Plotting every probability curve
I don't have a logistic regression model and am trying to generate
probability curves for all possible combinations of
the variables. My logit model has 5+ variables, and I want to draw curves
for every scenario.
See code below. When home_owner is 0 and 1, I want curves. The same goes
for all other variables categories, so that
I have permutations for all possible combinations.
I've
2012 Jul 19
3
Removing values from a string
So I have the following data frame and I want to know how I can remove all
"NA" values from each string, and also
remove all "|" values from the START of the string. So they should
something like "auto|insurance" or "auto|insurance|quote"
one = data.frame(keyword=c("|auto", "NA|auto|insurance|quote",
"NA|auto|insurance",
2012 May 03
1
overlapping confidence bands for predicted probabilities from a logistic model
Dear list,
I'm a bit perplexed why the 95% confidence bands for the predicted probabilities for units where x=0 and x=1 overlap in the following instance.
I've simulated binary data to which I've then fitted a simple logistic regression model, with one covariate, and the coefficient on x is statistically significant at the 0.05 level. I've then used two different methods to
2011 Dec 22
0
Finding predicted probabilities
I ran three logit models in R with the Zelig package and I'm trying to
compute the
predicted probabilities for a number of different values on the independent
variable.
My dep variable was accepted or decline and my indep variable is bid
amount, and varies.
So for a bid amount of 3, what's the expected probability of winning.
For a bid amount of 5, what's the expected probability of
2011 Dec 22
1
Error message with glm
I'm working on a logistic regression in R with the car package but keep
getting the following error message.
It's only and warning and not an error, but I'm just not sure how to
resolve the issues.
glm.fit: algorithm did not converge
glm.fit: fitted probabilities numerically 0 or 1 occurred
d1 = data.frame(mwin=c(mwin), mbid=c(mbid))
m1 = zelig(mwin ~ mbid, data=d1,
2011 Dec 21
1
Predicting a linear model for all combinations
Lets say I have a linear model and I want to find the average expented
value of the dependent variable. So let's assume that I'm studying the
price I pay for coffee.
Price = B0 + B1(weather) + B2(gender) + ...
What I'm trying to find is the predicted price for every possible
combination of values in the independent variables.
So Expected price when:
weather=1, gender=male
weather=1,
2012 Feb 09
1
Grouping together a time variable
I have the following variable, time, which is a character variable and it's
structured as follows.
> head(as.character(dat$time), 30) [1] "00:00:01" "00:00:16" "00:00:24" "00:00:25" "00:00:25" "00:00:40" "00:01:50" "00:01:54" "00:02:33" "00:02:43" "00:03:22"
[12]
2012 Aug 02
1
Naive Bayes in R
I'm developing a naive bayes in R. I have the following data and am trying
to predict on returned (class).
dat = data.frame(home=c(0,1,1,0,0), gender=c("M","M","F","M","F"),
returned=c(0,0,1,1,0))
str(dat)
dat$home <- as.factor(dat$home)
dat$returned <- as.factor(dat$returned)
library(e1071)
m <- naiveBayes(returned ~ ., dat)
m
2012 Aug 08
1
Calculating percentages across multiple columns
I have the following data and am trying to find the percentage of bid
values purchased for that price.
So let's say I have a bid of 5 and it's sold 2 times for $3 and $5. Since
the original bid was $5, the
percentage of times that that bid value results in a sold purchase AT that
specific bid level was
1/3 because of the three time where the bid was three, it ended up being
sold for $5
2008 Aug 31
1
Fitted probabilities in conditional logit regression
Dear R-help,
I'm doing conditional logit regression for a discrete choice model.
I want to know whether there's a way to get the fitted probabilities. In
Stata, "predict" works for clogit, but it seems that in R "predict" does
not.
Thank you very much!
Best wishes.
Sincerely,
Min
--
Min Chen
Graduate Student
Department of Agricultural,
2011 Mar 10
0
confidence intervals when using polr()
Hello, I am running a model with four categories and want predicted
probabilities in each category. Now for this example I wont give a
counterfactual just the training data is fine but is there anyway to get a
confidence interval around the predicted probabilities in each group? I have
tried but it gives me probabilities and I have used interval="confidence",
level=.095 and then interval
2012 Jul 09
1
Using the effects package
I've been looking into the effects package and it seems to be a great tool
for plotting the probabilities of the
response variable by the predictors. However, I'm wonder if I can use the
effects package to plot the probabilities
on the y axis and one predictor on the x axis, with the curve having the
info for another predictor.
So let's say our response variable is win, a binary
2007 Dec 04
2
confidence intervals for y predicted in non linear regression
Hi, I´m trying to plot a nonlinear regresion with the confidence bands for
the curve obtained, similar to what nlintool or nlpredci functions in Matlab
does, but I no figure how to. In nls the option is there but not implemented
yet.
Is there a plan to implement the in a relative near future?
Thanks in advance, Florencio
La información contenida en este e-mail y sus ficheros adjuntos es
2009 Apr 27
1
plot estimates and their 95% confidence intervals
Hi, there:
I have a dataset with 50 states and for each state, I have its associated mean estimate (for some parameters) and the lower and upper bound of the 95% CI. The data look like below:
state ami_mean ami_low ami_up
1 MS -0.58630 -0.90720 -0.29580
2 KY -0.48100 -0.75990 -0.19470
3 FL -0.47900 -0.62930 -0.32130
I would like to have a plot the 95% CI (characterized by
2007 Dec 05
1
confidence intervals for y predicted in non linearregression
Hi Thanks for your suggestion, I'm trying to install this package in Ubuntu
(7.10) but unsuccessfully. Also tried in MacOSX, and no success too.
_____
De: Ndoye Souleymane [mailto:ndoye_p@hotmail.com]
Enviado el: miércoles, 05 de diciembre de 2007 13:38
Para: bady@univ-lyon1.fr; Florencio González
CC: r-help@stat.math.ethz.ch
Asunto: RE: [R] confidence intervals for y predicted in
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