Questions tagged [logistic]

Refers generally to statistical procedures that utilize the logistic function, most commonly various forms of logistic regression

Filter by
Sorted by
Tagged with
18
votes
2answers
15k views

Can I use glm algorithms to do a multinomial logistic regression?

I am using spotfire (S++) for statistical analysis in my project and I have to run multinomial logistic regression for a large data set. I know best algorithm would have been mlogit, but unfortunately ...
18
votes
3answers
800 views

Analysis of Danish mask study data by Nassim Nicholas Taleb (binomial GLM with complete separation)

Recently, Nassim Nicholas Taleb made this post about the recent Danish mask study, a randomized controlled trial which concluded that the proportions of newly diagnosed coronavirus infections was not ...
18
votes
2answers
13k views

Pearson VS Deviance Residuals in logistic regression

I know that standardized Pearson Residuals are obtained in a traditional probabilistic way: $$ r_i = \frac{y_i-\hat{\pi}_i}{\sqrt{\hat{\pi}_i(1-\hat{\pi}_i)}}$$ and Deviance Residuals are obtained ...
18
votes
2answers
17k views

Ordinal logistic regression in Python

I would like to run an ordinal logistic regression in Python - for a response variable with three levels and with a few explanatory factors. The statsmodels package ...
17
votes
2answers
10k views

How can I use logistic regression betas + raw data to get probabilities

I have a model fitted (from the literature). I also have the raw data for the predictive variables. What's the equation I should be using to get probabilities? Basically, how do I combine raw data ...
17
votes
2answers
1k views

categorizing a variable turns it from insignificant to significant

I have a numeric variable which turns out not significant in a multivariate logistic regression model. However, when I categorize it into groups, suddenly it becomes significant. This is very counter-...
17
votes
1answer
8k views

Negative coefficient in ordered logistic regression

Suppose we have the ordinal response $y:\{\text{Bad, Neutral, Good}\} \rightarrow \{1,2,3\}$ and a set of variables $X:=[x_1,x_2,x_3]$ that we think will explain $y$. We then do an ordered logistic ...
17
votes
1answer
4k views

Properties of logistic regressions

We're working with some logistic regressions and we have realized that the average estimated probability always equals the proportion of ones in the sample; that is, the average of fitted values ...
17
votes
3answers
8k views

What is the relationship between the Beta distribution and the logistic regression model?

My question is: What is the mathematical relationship between the Beta distribution and the coefficients of the logistic regression model? To illustrate: the logistic (sigmoid) function is given by $...
17
votes
2answers
5k views

Is decision threshold a hyperparameter in logistic regression?

Predicted classes from (binary) logistic regression are determined by using a threshold on the class membership probabilities generated by the model. As I understand it, typically 0.5 is used by ...
17
votes
2answers
19k views

Can we use categorical independent variable in discriminant analysis?

In discriminant analysis, the dependent variable is categorical, but can I use a categorical variable (e.g residential status: rural, urban) along with some other continuous variable as independent ...
17
votes
2answers
27k views

How do I run Ordinal Logistic Regression analysis in R with both numerical / categorical values?

Base Data: I have ~1,000 people marked with assessments: '1,' [good] '2,' [middle] or '3' [bad] -- these are the values I'm trying to predict for people in the future. In addition to that, I have some ...
17
votes
2answers
11k views

Why P>0.5 cutoff is not “optimal” for logistic regression?

PREFACE: I don't care about the merits of using a cutoff or not, or how one should choose a cutoff. My question is purely mathematical and due to curiosity. Logistic regression models the posterior ...
17
votes
3answers
1k views

Logistic Regression and Dataset Structure

I am hoping that I can ask this question the correct way. I have access to play-by-play data, so it's more of an issue with best approach and constructing the data properly. What I am looking to do ...
17
votes
1answer
16k 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 ...
17
votes
1answer
31k views

From exp (coefficients) to Odds Ratio and their interpretation in Logistic Regression with factors

I ran a linear regression of acceptance into college against SAT scores and family / ethnic background. The data are fictional. This is a follow-up on a prior question, already answered. The question ...
17
votes
2answers
18k views

Interpretation of ordinal logistic regression

I ran this ordinal logistic regression in R: mtcars_ordinal <- polr(as.factor(carb) ~ mpg, mtcars) I got this summary of the model: ...
17
votes
1answer
12k views

Input format for response in binomial glm in R

In R, there are three methods to format the input data for a logistic regression using the glm function: Data can be in a "...
17
votes
3answers
10k views

Differences between logistic regression and perceptrons

As I understand, a perceptron/single-layer artificial neural network with a logistic sigmoid activation function is the same model as logistic regression. Both models are given by the equation: $F(x) ...
16
votes
2answers
19k views

How to plot decision boundary in R for logistic regression model?

I made a logistic regression model using glm in R. I have two independent variables. How can I plot the decision boundary of my model in the scatter plot of the two variables. For example, how can ...
16
votes
1answer
21k views

What is the difference between decision_function, predict_proba, and predict function for logistic regression problem?

I have been going through the sklearn documentation but I am not able to understand the purpose of these functions in the context of logistic regression. For ...
16
votes
2answers
32k views

Output of Logistic Regression Prediction

I have created a Logistic Regression using the following code: ...
16
votes
5answers
20k views

Is logistic regression a non-parametric test?

I recently received the following question via email. I'll post an answer below, but I was interested to hear what others thought. Would you call logistic regression a non-parametric test? My ...
16
votes
3answers
60k views

Intercept term in logistic regression

Suppose we have the following logistic regression model: $$\text{logit}(p) = \beta_0+\beta_{1}x_{1} + \beta_{2}x_{2}$$ Is $\beta_0$ the odds of the event when $x_1 = 0$ and $x_2=0$? In other words, ...
16
votes
1answer
5k views

The difference between with or without intercept model in logistic regression

I like to understand the difference between with or without intercept model in logistic regression Is there any difference between them except that with the intercept the coefficients regard the log(...
16
votes
3answers
56k views

How to build a confusion matrix for a multiclass classifier?

I have a problem with 6 classes. So I build a multiclass classifier, as follows: for each class, I have one Logistic Regression classifier, using One vs. All, which means that I have 6 different ...
16
votes
1answer
6k views

Regularized bayesian logistic regression in JAGS

There are several math-heavy papers that describe the Bayesian Lasso, but I want tested, correct JAGS code that I can use. Could someone post sample BUGS / JAGS code that implements regularized ...
16
votes
3answers
22k views

Do coefficients of logistic regression have a meaning?

I have a binary classification problem from several features. Do the coefficients of a (regularized) logistic regression have an interpretable meaning? I thought they could indicate the size of ...
16
votes
3answers
6k views

Logistic Regression: Scikit Learn vs glmnet

I am trying to duplicate the results from sklearn logistic regression library using glmnet package in R. From the ...
16
votes
3answers
30k views

Cox model vs logistic regression

Let's say we are given the following problem: Predict which clients are most likely to stop buying in our shop in next 3 months. For each client we know the month when one started to buy in our ...
15
votes
4answers
1k views

Dichotomizing continuous variables at their optimal cut-off for clinical interpretation

In medical context, when presenting results from a binary outcome with a continuous predictor, the OR (odds ratio) can be difficult to interpret. Example: A doctor does a study in which he wants to ...
15
votes
5answers
2k views

Philosophical question on logistic regression: why isn't the optimal threshold value trained?

Usually in logistic regression, we fit a model and get some predictions on the training set. We then cross-validate on those training predictions (something like here) and decide the optimal threshold ...
15
votes
5answers
56k views

How to interpret a ROC curve?

I applied logistic regression to my data on SAS and here are the ROC curve and classification table. I am comfortable with the figures in the classification table, but not exactly sure what the roc ...
15
votes
4answers
5k views

Is the logit function always the best for regression modeling of binary data?

I've been thinking about this problem. The usual logistic function for modeling binary data is: $$ \log\left(\frac{p}{1-p}\right)=\beta_0+\beta_1X_1+\beta_2X_2+\ldots $$ However is the logit function,...
15
votes
3answers
9k views

Discriminant analysis vs logistic regression

I found some pros of discriminant analysis and I've got questions about them. So: When the classes are well-separated, the parameter estimates for logistic regression are surprisingly unstable. ...
15
votes
3answers
2k views

Intuition for Support Vector Machines and the hyperplane

In my project I want to create a logistic regression model for predicting binary classification (1 or 0). I have 15 variables, 2 of which are categorical, while the rest are a mixture of continuous ...
15
votes
2answers
12k views

Overdispersion in logistic regression

I'm trying to get a handle on the concept of overdispersion in logistic regression. I've read that overdispersion is when observed variance of a response variable is greater than would be expected ...
15
votes
2answers
5k views

Why use the logit link in beta regression?

Recently, I have been interested in implementing a beta regression model, for an outcome that is a proportion. Note that this outcome would not fit into a binomial context, because there is no ...
15
votes
2answers
3k views

How can Logistic Regression produce curves that aren't traditional functions?

I think I have some fundamental confusion about how the functions in Logistic regression work (or maybe just functions as a whole). How is it that the function h(x) produces the curve seen in the ...
15
votes
3answers
14k views

R package for fixed-effect logistic regression

I'm looking for an R package for estimating the coefficients of logit models with individual fixed-effect (individual intercept) using Chamberlain's 1980 estimator. ...
15
votes
4answers
9k views

What loss function should one use to get a high precision or high recall binary classifier?

I'm trying to make a detector of objects that occur very rarely (in images), planning to use a CNN binary classifier applied in a sliding/resized window. I've constructed balanced 1:1 positive-...
15
votes
1answer
7k views

Seeking a Theoretical Understanding of Firth Logistic Regression

I am trying to understand Firth logistic regression (method of handling perfect/complete or quasi-complete separation in logistic regression) so I can explain it to others in simplified terms. Does ...
15
votes
2answers
8k views

Applying logistic regression with low event rate

I have a dataset in which the event rate is very low ( 40,000 out of $12\cdot10^5$). I am applying logistic regression on this. I have had a discussion with someone where it came out that logistic ...
15
votes
1answer
5k views

Why is it wrong to interpret SVM as classification probabilities?

My understanding of SVM is that it's very similar to a logistic regression (LR), i.e. a weighted sum of features is passed to the sigmoid function to get a probability of belonging to a class, but ...
15
votes
2answers
4k views

Pros and Cons of Log Link Versus Identity Link for Poisson Regression

I am carrying out a Poisson regression with the end goal of comparing (and taking the difference of) the predicted mean counts between two factor levels in my model: $\hat{\mu}_1-\hat{\mu}_2$, while ...
15
votes
3answers
383 views

Comparison of statistical tests exploring co-dependence of two binary variables

Suppose we observe data $(X_i,Y_i)_{i=1,...,n}$ on two binary variables: $X\in\{0,1\}$ and $Y\in\{0,1\}$. We would like to test if $X$ and $Y$ are co-dependent (related). Standard suggestions in ...
14
votes
3answers
15k views

How to test for simultaneous equality of choosen coefficients in logit or probit model?

How to test for simultaneous equality of choosen coefficients in logit or probit model ? What is the standard approach and what is the state of art approach ?
14
votes
3answers
9k views

How do I train a (logistic?) regression in R using L1 loss function?

I can train a logistic regression in R using glm(y ~ x, family=binomial(logit))) but, IIUC, this optimizes for log likelihood....
14
votes
4answers
7k views

If each neuron in a neural network is basically a logistic regression function, why multi layer is better?

I'm going thru the Cousera's DeepAI course (Week3 video 1 "Neural Networks Overview") and Andrew Ng is explaining how each layer in a neural network is just another logistic regression, but he doesn't ...
14
votes
3answers
13k views

Testing nonlinearity in logistic regression (or other forms of regression)

One of the assumption of logistic regression is the linearity in the logit. So once I got my model up and running I test for nonlinearity using Box-Tidwell test. One of my continuous predictors (X) ...