Displaying 20 results from an estimated 10000 matches similar to: "modelling probabilities instead of binary data with logistic regression"
2009 Sep 04
1
Multinomial and Ordinal Logistic Regression - Probability calculation
Dear all,
I am new to R and would like to run a multinomial logistic regression on my dataset (3 predictors for 1 dependent variables)
I have used the vglm function from the VGAM package and got some results. Using the predict() function, I obtained the probability table I was looking for. However, I would like to fully understand how the predict() function generates the probabilities or in
2013 Jan 28
1
incorrect import?
Dear all,
I'm not getting what I'm doing wrong. The line below from my read.fsa.bin function throws an error when just loading my AFLP package and disappears when I load the zoo package as well.
#the line that throws the error
Index <- which(Peak == rollmax(Peak, k = 1 + 2 * floor((min(diff(SizeStandard)) * Fs - 1) / 2), fill = -Inf))
#the error
Error in UseMethod("rollmax")
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 Mar 24
0
Adapting thresholds for predictions of ordinal logistic regression
I'm dealing with a classification problem using ordinal logistic
regression. In the case of binary logistic regression with unequal
proportions of 0's and 1's, a threshold in the interval [0,1] has to be
adapted to transform back the predicted probabilities into 0 and 1.
This can be done quite straightforward using e.g. the Kappa statistics
as accuracy criterion.
With
2013 Jan 24
4
Difference between R and SAS in Corcordance index in ordinal logistic regression
lrm does some binning to make the calculations faster. The exact calculation
is obtained by running
f <- lrm(...)
rcorr.cens(predict(f), DA), which results in:
C Index Dxy S.D. n missing
0.96814404 0.93628809 0.03808336 32.00000000 0.00000000
uncensored Relevant Pairs Concordant Uncertain
32.00000000
2008 Dec 28
1
Logistic regression with rcs() and inequality constraints?
Dear guRus,
I am doing a logistic regression using restricted cubic splines via
rcs(). However, the fitted probabilities should be nondecreasing with
increasing predictor. Example:
predictor <- seq(1,20)
y <- c(rep(0,9),rep(1,10),0)
model <- glm(y~rcs(predictor,n.knots=3),family="binomial")
print(1/(1+exp(-predict(model))))
The last expression should be a nondecreasing
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
2010 Jun 23
1
Probabilities from survfit.coxph:
Hello:
In the example below (or for a censored data) using survfit.coxph, can
anyone point me to a link or a pdf as to how the probabilities appearing in
bold under "summary(pred$surv)" are calculated? Do these represent
acumulative probability distribution in time (not including censored time)?
Thanks very much,
parmee
*fit <- coxph(Surv(futime, fustat) ~ age, data = ovarian)*
2009 Apr 30
1
Hoe to get RESIDUAL VARIANCE in logistic regression using lmer
Hello everybody,
using the lmer function, I have fitted the following logistic mixed
regression model on an experimental data set containing one fixed factor
(Cond) and three random variables (Sito, Area, Trans):
> model<-lmer(Caul~Cond+(1|Sito)+(1|Area)+(1|Trans), data=dataset,
> family=binomial)
this is the output:
> summary(model)
Generalized linear mixed model fit by the
2005 Apr 15
1
Range in probabilities of a fitted lrm model (Y~X)
Dear R-list,
Is there a function or technique by which the probability (or log odds)
range of a logistic model (fit <- lrm(Y~X)) can be derived?
The aim is to obtain min & max of the estimated probabilities of Y.
Could summary.Design() be used for that or is there another method/trick?
Thanks,
Jan
_______________________________________________________________________
ir. Jan
2010 May 26
1
validation logistic regression
Hi
I did validation for prediction by logistic regression according to following:
validationsize <- 23
set.seed(1)
random<-runif(123)
order(random)
nrprofilesinsample<-sort(order(random)[1:100])
profilesample <- data[nrprofilesinsample,]
profilevalidation <- data[-nrprofilesinsample,]
salich<-profilesample$SALIC.H.1
salic.lr<-glm(salich~wetnessindex, profilesample,
2007 Jan 21
1
logistic regression model + Cross-Validation
Hi,
I am trying to cross-validate a logistic regression model.
I am using logistic regression model (lrm) of package Design.
f <- lrm( cy ~ x1 + x2, x=TRUE, y=TRUE)
val <- validate.lrm(f, method="cross", B=5)
My class cy has values 0 and 1.
"val" variable will give me indicators like slope and AUC. But, I also need
the vector of predicted values of class variable
2007 Mar 26
1
fitted probabilities in multinomial logistic regression are identical for each level
I was hoping for some advice regarding possible explanations for the
fitted probability values I obtained for a multinomial logistic
regression. The analysis aims to predict whether Capgras delusions
(present/absent) are associated with group (ABH, SV, homicide; values
= 1,2,3,), controlling for previous violence. What has me puzzled is
that for each combination the fitted probabilities are
2011 Dec 01
1
logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred
Sorry if this is a duplicate: This is a re-post because the pdf's mentioned
below did not go through.
Hello,
I'm new'ish to R, and very new to glm. I've read a lot about my issue:
Warning message:
glm.fit: fitted probabilities numerically 0 or 1 occurred
...including:
http://tolstoy.newcastle.edu.au/R/help/05/07/7759.html
2004 Dec 05
4
What is the most useful way to detect nonlinearity in logistic regression?
It is easy to spot response nonlinearity in normal linear models using
plot(something.lm).
However plot(something.glm) produces artifactual peculiarities since the
diagnostic residuals are constrained by the fact that y can only take
values 0 or 1.
What do R users find most useful in checking the linearity assumption of
logistic regression (i.e. log-odds =a+bx)?
Patrick Foley
patfoley at
2010 May 28
2
Handing significance digits
Hi folks, recently I was trying evaluation of some complex function having
exactly same starting values as well as same algorithm in both R and .Net
environment. However at the end point I notice that there are some
differences in the reported figures from those two applications (as much as
0.10%). I feel this is basically due to consideration of different
significance digits in handling floating
2004 Feb 16
1
Binary logistic model using lrm function
Hello all,
Could someone tell me what I am doing wrong here?
I am trying to fit a binary logistic model using the lrm function in Design.
The dataset I am using has a dichotomous response variable, 'covered'
(1-yes, 0-no) with explanatory variables, 'nepall', 'title', 'abstract',
'series', and 'author1.'
I am running the following script and
2024 Jul 13
1
Obtaining predicted probabilities for Logistic regression
Hi,
I ran below code
Dat = read.csv('https://raw.githubusercontent.com/sam16tyagi/Machine-Learning-techniques-in-python/master/logistic%20regression%20dataset-Social_Network_Ads.csv')
head(Dat)
Model = glm(Purchased ~ Gender, data = Dat, family = binomial())
head(predict(Model, type="response"))
My_Predict = 1/(1+exp(-1 * (as.vector(coef(Model))[1] *
as.vector(coef(Model))[2] *
2010 Jun 03
1
Continous variables with implausible transformation?
Dear r users
I have a question in coding continuous variables in logistic regression.
When "rcs" is used in transforming variables, sometime it gives implausible
associations with the outcome although the model x2 is high.
So what's your tips and tricks in coding continuous variables.
P.S. How to code variables as linear+square in the formula such as lrm.
lrm(y~x+sqrt(x))
2011 Aug 05
1
Goodness of fit of binary logistic model
Dear All,
I have just estimated this model:
-----------------------------------------------------------
Logistic Regression Model
lrm(formula = Y ~ X16, x = T, y = T)
Model Likelihood Discrimination Rank Discrim.
Ratio Test Indexes Indexes
Obs 82 LR chi2 5.58 R2 0.088 C 0.607
0