Displaying 20 results from an estimated 11000 matches similar to: "Obtaining R-squared value in Logistic Regression"
2012 Oct 23
3
Error in contrasts message when using logistic regression code.
I have a rather large data set (about 30 predictor variables)
I need to preform a logistic regression on this data. My response variable
is binary.
My code looks like this:
mylogit <- glm(Enrolled ~ A + B + C + ... + EE, data = data, family =
binomial(link="logit"))
with A,B,C, ... as my predictor variables. Some categorical, some
continuous, some binary.
I run the code and get
2005 Mar 29
2
R-squared in Logistic Regression
Dear all,
How do I make R show the R-squared (deviance explained by the model) in
a logistic regression?
Below is how I write my syntax. Basically I want to investigate
density-dependence in parasitism of larvae. Note that in the end I
perform a F-test because the dispersion factor (residual deviance /
residual df) is significantly higher than 1. But how do I make R show
the
2007 Feb 14
1
model diagnostics for logistic regression
Greetings,
I am using both the lrm() {Design} and glm( , family=binomial()) to perform a
a logisitic regression in R. Apart from the typical summary() methods, what
other methods of diagnosing logistic regression models does R provide? i.e.
plotting an 'lm' object, etc.
Secondly, is there any facility to calculate the R^{2)_{L} as suggested by
Menard in "Applied Logistic
2005 Aug 13
1
Penalized likelihood-ratio chi-squared statistic: L.R. model for Goodness of fit?
Dear R list,
From the lrm() binary logistic model we derived the G2 value or the
likelihood-ratio chi-squared statistic given as L.R. model, in the output of
the lrm().
How can this value be penalized for non-linearity (we used splines in the
lrm function)?
lrm.iRVI <- lrm(arson ~ rcs(iRVI,5),
penalty=list(simple=10,nonlinear=100,nonlinear.interaction=4))
This didn’t work
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
2002 Aug 04
5
Pseudo R^2 for logit - really naive question
I am using GLM to calculate logit models based on cross-sectional data. I
am now down to the hard work of making the results intelligible to very
average readers. Is there any way to calculate a psuedo analoque to the R^2
in standard linear regression for use as a purely descriptive statistic of
goodness of fit? Most of the readers of my report will be vaguely familiar
and more comfortable with
2009 Aug 03
1
penalized logistic regression
Hi, R users,
Is there any package for penalized logistic regression with more than two
response classes? I read the manual for stepPlr, but it seems it's only for
binary case.
Thank you,
Annie
[[alternative HTML version deleted]]
2011 Apr 11
1
pseudo-R by hand
hello dear list! since we want to do a model analysis and some people
would like to see pseudo-R^2 values for different types of glm of a
logistic regression, i've decided to write a function that computes
either nagelkerkes normed pseudo-R or cox & snells pseudo-R. however, i
am not clear as in the decisive step, i need to calculate the log of
(maximum likelihood estimates of model
2007 Sep 25
1
Score test in logistic regression in R
Hello,
I am wondering if R has any ways to conduct the score test in logistic
regression?
Could you let me know please?
Thanks,
Insu
--------------------------------------------------
This e-mail and any files transmitted with it may contain privileged or confidential information.
It is solely for use by the individual for whom it is intended, even if addressed incorrectly.
If you
2010 Feb 06
4
Plot of odds ratios obtained from a logistic model
Hi all!
I am trying to develop a plot a figure in which I would like to show
the odds ratios obtained from a logistic model. I have tried with the
dotplot option but no success. Could you help me? Is there any option
when modelling the logistic model in R?
Thank you in advance
2009 Oct 31
2
Logistic and Linear Regression Libraries
Hi all,
I'm trying to discover the options available to me for logistic and linear
regression. I'm doing some tests on a dataset and want to see how different
flavours of the algorithms cope.
So far for logistic regression I've tried glm(MASS) and lrm (Design) and
found there is a big difference. Is there a list anywhere detailing the
options available which details the specific
2009 Jul 17
2
Getting the C-index for a dataset that was not used to generate the logistic model
Does anyone know how to get the C-index from a logistic model - not using
the dataset that was used to train the model, but instead using a fresh
dataset on the same model?
I have a dataset of 400 points that I've split into two halves, one for
training the logistic model, and the other for evaluating it. The structure
is as follows:
column headers are "got a loan" (dichotomous),
2004 Dec 15
2
how to fit a weighted logistic regression?
I tried lrm in library(Design) but there is always
some error message. Is this function really doing the
weighted logistic regression as maximizing the
following likelihood:
\sum w_i*(y_i*\beta*x_i-log(1+exp(\beta*x_i)))
Does anybody know a better way to fit this kind of
model in R?
FYI: one example of getting error message is like:
> x=runif(10,0,3)
> y=c(rep(0,5),rep(1,5))
>
2009 Nov 14
1
setting contrasts for a logistic regression
Hi everyone,
I'm doing a logistic regression with an ordinal variable. I'd like to set
the contrasts on the ordinal variable. However, when I set the contrasts,
they work for ordinary linear regression (lm), but not logistic regression
(lrm):
ddist = datadist(bin.time, exp.loc)
options(datadist='ddist')
contrasts(exp.loc) = contr.treatment(3, base = 3, contrasts = TRUE)
lrm.loc =
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
2012 Nov 04
1
Changing Date Variables as Continuous Variables
I am very new to R, so I apologize if this question is trivial.
I have a row in my data of dates in the format mm/dd/yyyy; about 3500 rows.
I am using this variable in a logistic regression model, and need to treat
it as continuous, not a factor as r has decided it is.
I tried the as.numeric function but it resulted in all NA's and the message:
"NAs introduced by coercion "
If
2006 Nov 21
1
Logistic regression model (Urjent help needed)
I am using logistic regression model (lrm) of package Design.
Can some one please tell me how to calculate the average Area Under Curve
(AUC) for n-fold cross-validation
The help for lrm function says to do cross validation like this
f <- lrm( cy ~ x1 + x2, x=TRUE, y=TRUE)
val <- validate.lrm(f, method="cross", B=5)
Now I dont know what to do with variable "val" to
2009 Sep 26
2
Design Package - Penalized Logistic Reg. - Query
Dear R experts,
The lrm function in the Design package can perform penalized (Ridge)
logistic regression. It is my understanding that the ridge solutions are not
equivalent under scaling of the inputs, so one normally standardizes the
inputs. Do you know if input standardization is done internally in lrm or I
would have to do it prior to applying this function.
Also, as I'm new in R (coming
2008 Mar 03
1
using 'lrm' for logistic regression
Hi R,
I am getting this error while trying to use 'lrm' function with nine
independent variables:
> res =
lrm(y1994~WC08301+WC08376+WC08316+WC08311+WC01001+WC08221+WC08106+WC0810
1+WC08231,data=y)
singular information matrix in lrm.fit (rank= 8 ). Offending
variable(s):
WC08101 WC08221
Error in j:(j + params[i] - 1) : NA/NaN argument
Now, if I take choose only four
2011 May 18
1
logistic regression lrm() output
Hi, I am trying to run a simple logistic regression using lrm() to calculate a
odds ratio. I found a confusing output when I use summary() on the fit object
which gave some OR that is totally different from simply taking
exp(coefficient), see below:
> dat<-read.table("dat.txt",sep='\t',header=T,row.names=NULL)
> d<-datadist(dat)
> options(datadist='d')