Questions tagged [logistic]
Refers generally to statistical procedures that utilize the logistic function, most commonly various forms of logistic regression
1,255
questions
203
votes
10
answers
219k
views
How to deal with perfect separation in logistic regression?
If you have a variable which perfectly separates zeroes and ones in target variable, R will yield the following "perfect or quasi perfect separation" warning message:
...
381
votes
12
answers
367k
views
Difference between logit and probit models
What is the difference between Logit and Probit model?
I'm more interested here in knowing when to use logistic regression, and when to use Probit.
If there is any literature which defines it using ...
120
votes
3
answers
125k
views
Does an unbalanced sample matter when doing logistic regression?
Okay, so I think I have a decent enough sample, taking into account the 20:1 rule of thumb: a fairly large sample (N=374) for a total of 7 candidate predictor variables.
My problem is the following: ...
29
votes
1
answer
12k
views
Omitted variable bias in logistic regression vs. omitted variable bias in ordinary least squares regression
I have a question about omitted variable bias in logistic and linear regression.
Say I omit some variables from a linear regression model. Pretend that those omitted variables are uncorrelated with ...
116
votes
4
answers
45k
views
Why isn't Logistic Regression called Logistic Classification?
Since Logistic Regression is a statistical classification model dealing with categorical dependent variables, why isn't it called Logistic Classification? Shouldn't the "Regression" name be reserved ...
36
votes
2
answers
34k
views
Interpretation of simple predictions to odds ratios in logistic regression
I'm somewhat new to using logistic regression, and a bit confused by a discrepancy between my interpretations of the following values which I thought would be the same:
exponentiated beta values
...
71
votes
9
answers
85k
views
Which pseudo-$R^2$ measure is the one to report for logistic regression (Cox & Snell or Nagelkerke)?
I have SPSS output for a logistic regression model. The output reports two measures for the model fit, Cox & Snell and ...
99
votes
5
answers
151k
views
How to calculate Area Under the Curve (AUC), or the c-statistic, by hand
I am interested in calculating area under the curve (AUC), or the c-statistic, by hand for a binary logistic regression model.
For example, in the validation dataset, I have the true value for the ...
43
votes
2
answers
24k
views
Simulation of logistic regression power analysis - designed experiments
This question is in response to an answer given by @Greg Snow in regards to a question I asked concerning power analysis with logistic regression and SAS ...
63
votes
1
answer
20k
views
Logistic regression in R resulted in perfect separation (Hauck-Donner phenomenon). Now what? [duplicate]
I'm trying to predict a binary outcome using 50 continuous explanatory variables (the range of most of the variables is $-\infty$ to $\infty$). My data set has almost 24,000 rows. When I run ...
63
votes
4
answers
50k
views
Regression for an outcome (ratio or fraction) between 0 and 1
I am thinking of building a model predicting a ratio $a/b$, where $a \le b$ and $a > 0$ and $b > 0$. So, the ratio would be between $0$ and $1$.
I could use linear regression, although it doesn'...
54
votes
1
answer
19k
views
Why do my p-values differ between logistic regression output, chi-squared test, and the confidence interval for the OR?
I have built a logistic regression where the outcome variable is being cured after receiving treatment (Cure vs. No Cure). All ...
34
votes
6
answers
117k
views
Sample size for logistic regression?
I want to make a logistic model from my survey data. It is a small survey of four residential colonies in which only 154 respondents were interviewed. My dependent variable is "satisfactory transition ...
45
votes
1
answer
13k
views
Does down-sampling change logistic regression coefficients?
If I have a dataset with a very rare positive class, and I down-sample the negative class, then perform a logistic regression, do I need to adjust the regression coefficients to reflect the fact that ...
14
votes
2
answers
23k
views
Bayesian logit model - intuitive explanation?
I must confess that I previously haven't heard of that term in any of my classes, undergrad or grad.
What does it mean for a logistic regression to be Bayesian? I'm looking for an explanation with a ...
139
votes
3
answers
273k
views
What is the difference between linear regression and logistic regression?
What is the difference between linear regression and logistic regression?
When would you use each?
51
votes
1
answer
42k
views
Regression: Transforming Variables
When transforming variables, do you have to use all of the same transformation? For example, can I pick and choose differently transformed variables, as in:
Let, $x_1,x_2,x_3$ be age, length of ...
23
votes
2
answers
6k
views
What is happening here, when I use squared loss in logistic regression setting?
I am trying to use squared loss to do binary classification on a toy data set.
I am using mtcars data set, use mile per gallon and weight to predict transmission ...
29
votes
3
answers
44k
views
How to handle ordinal categorical variable as independent variable
I am using a logit model. My dependent variable is binary. However I have an independent variable which is categorical and contains the responses: ...
5
votes
1
answer
10k
views
Logistic regression with poor goodness of fit (hosmer lemeshow)?
I built a model with 9 categorical predictor variables. Using SPSS, my omnibus test was significant ($\chi^2$=220.01), my -2loglikelihood was 1335.2 (Nagelkerke $R^2$ 0.231), but my Hosmer and ...
27
votes
1
answer
27k
views
Help me understand adjusted odds ratio in logistic regression
I've been having a hard time trying to understand the use of logistic regression in a paper. The paper available here uses logistic regression to predict probability of complications during cataract ...
12
votes
1
answer
12k
views
Interpretation of Fixed Effects from Mixed Effect Logistic Regression
I am confused by statements at a UCLA webpage about mixed effects logistic regression. They show a table of fixed effects coefficients from fitting such a model and the first paragraph belows seems to ...
7
votes
5
answers
17k
views
Coefficient changes sign when adding a variable in logistic regression
In my logistic regression the sign of coefficients of a variable (location distance of an amenity) changes based on other variables (with time -ve, with travel distance +ve) in the model. When the ...
12
votes
2
answers
40k
views
Significant predictors become non-significant in multiple logistic regression
When I analyze my variables in two separate (univariate) logistic regression models, I get the following:
...
114
votes
4
answers
213k
views
What is rank deficiency, and how to deal with it?
Fitting a logistic regression using lme4 ends with
Error in mer_finalize(ans) : Downdated X'X is not positive definite.
A likely cause of this error is ...
91
votes
4
answers
60k
views
What is the difference between a "link function" and a "canonical link function" for GLM
What's the difference between terms 'link function' and 'canonical link function'? Also, are there any (theoretical) advantages of using one over the other?
For example, a binary response variable ...
56
votes
2
answers
57k
views
How to simulate artificial data for logistic regression?
I know I'm missing something in my understanding of logistic regression, and would really appreciate any help.
As far as I understand it, the logistic regression assumes that the probability of a '1' ...
55
votes
3
answers
55k
views
Regularization methods for logistic regression
Regularization using methods such as Ridge, Lasso, ElasticNet is quite common for linear regression. I wanted to know the following:
Are these methods applicable for logistic regression? If so, are ...
41
votes
2
answers
68k
views
Interpretation of plot (glm.model)
Can anyone tell me how to interpret the 'residuals vs fitted', 'normal q-q', 'scale-location', and 'residuals vs leverage' plots? I am fitting a binomial GLM, saving it and then plotting it.
30
votes
4
answers
28k
views
What is the relationship between regression and linear discriminant analysis (LDA)?
Is there a relationship between regression and linear discriminant analysis (LDA)? What are their similarities and differences? Does it make any difference if there are two classes or more than two ...
26
votes
2
answers
55k
views
Significance of categorical predictor in logistic regression
I am having trouble interpreting the z values for categorical variables in logistic regression. In the example below I have a categorical variable with 3 classes and according to the z value, CLASS2 ...
37
votes
4
answers
21k
views
Why does logistic regression become unstable when classes are well-separated?
Why is it that logistic regression becomes unstable when classes are well-separated? What does well-separated classes mean? I would really appreciate if someone can explain with an example.
22
votes
1
answer
22k
views
What is the difference between logistic regression and Fractional response regression?
As far as I know, the difference between logistic model and fractional response model (frm) is that the dependent variable (Y) in which frm is [0,1], but logistic is {0, 1}. Further, frm uses the ...
63
votes
4
answers
55k
views
Logistic Regression - Error Term and its Distribution
On whether an error term exists in logistic regression (and its assumed distribution), I have read in various places that:
no error term exists
the error term has a binomial distribution (in ...
57
votes
4
answers
47k
views
Multinomial logistic regression vs one-vs-rest binary logistic regression
Lets say we have a dependent variable $Y$ with few categories and set of independent variables.
What are the advantages of multinomial logistic regression over set of binary logistic regressions (i....
54
votes
2
answers
126k
views
Interpretation of R's output for binomial regression
I'm quite new on this with binomial data tests, but needed to do one and now I´m not sure how to interpret the outcome. The y-variable, the response variable, is binomial and the explanatory factors ...
37
votes
2
answers
30k
views
When is logistic regression solved in closed form?
Take $x \in \{0,1\}^d$ and $y \in \{0,1\}$ and suppose we model the task of predicting y given x using logistic regression. When can logistic regression coefficients be written in closed form?
One ...
36
votes
3
answers
29k
views
How to do logistic regression in R when outcome is fractional (a ratio of two counts)?
I'm reviewing a paper which has the following biological experiment. A device is used to expose cells to varying amounts of fluid shear stress. As greater shear stress is applied to the cells, more of ...
8
votes
3
answers
18k
views
Multiple logistic regression power analysis
I have a logistic regression model and output an $R^2$ value. I then go and add another predictor variable to fit a second model. I can output a new $R^2$ value associated with the second model. When ...
7
votes
2
answers
6k
views
How to use boxplots to find the point where values are more likely to come from different conditions?
I have plotted some data using box plots.
I am comparing Condition 1 (left) and Condition 2 (Right) values. My aim is to find a point at which we make a decision where the value changes from point ...
27
votes
1
answer
8k
views
Is there any intuitive explanation of why logistic regression will not work for perfect separation case? And why adding regularization will fix it?
We have many good discussions about perfect separation in logistic regression. Such as, Logistic regression in R resulted in perfect separation (Hauck-Donner phenomenon). Now what? and Logistic ...
124
votes
4
answers
240k
views
Softmax vs Sigmoid function in Logistic classifier?
What decides the choice of function ( Softmax vs Sigmoid ) in a Logistic classifier ?
Suppose there are 4 output classes . Each of the above function gives the probabilities of each class being the ...
79
votes
3
answers
48k
views
Diagnostics for logistic regression?
For linear regression, we can check the diagnostic plots (residuals plots, Normal QQ plots, etc) to check if the assumptions of linear regression are violated.
For logistic regression, I am having ...
53
votes
1
answer
59k
views
Obtaining predicted values (Y=1 or 0) from a logistic regression model fit
Let's say that I have an object of class glm (corresponding to a logistic regression model) and I'd like to turn the predicted probabilities given by ...
49
votes
2
answers
150k
views
Logistic regression model does not converge
I've got some data about airline flights (in a data frame called flights) and I would like to see if the flight time has any effect on the probability of a ...
42
votes
3
answers
27k
views
Logistic Regression: Bernoulli vs. Binomial Response Variables
I want to perform logistic regression with the following binomial response and with $X_1$ and $X_2$ as my predictors.
I can present the same data as Bernoulli responses in the following format.
The ...
10
votes
1
answer
840
views
Decision rule as a hyper-parameter in LASSO
I have a question that is related to the following: Is decision threshold a hyperparameter in logistic regression?
but would like some clarification.
The general consensus is that the decision rule ...
1
vote
3
answers
2k
views
Logistic Regression: How to call the output
I'm currently working on a scientific paper and I'm struggle to answer the following question: What is the right term for the output (ranging from 0 to 1) of a logistic regression?
Neither of these ...
52
votes
3
answers
38k
views
Why is there a difference between manually calculating a logistic regression 95% confidence interval, and using the confint() function in R?
Dear everyone - I've noticed something strange that I can't explain, can you? In summary: the manual approach to calculating a confidence interval in a logistic regression model, and the R function <...
24
votes
2
answers
23k
views
How to apply binomial GLMM (glmer) to percentages rather than yes-no counts?
I have a repeated-measures experiment where the dependent variable is a percentage, and I have multiple factors as independent variables. I'd like to use glmer from ...