2k views

### Logistic regression simulation in order to show that intercept is biased when Y=1 is rare [duplicate]

I'm trying to simulate a logistic regression. My goal is showing that if Y=1 is rare, than the intercept is biased. In my R script I define the logistic regression ...
2k views

### How to simulate a binary response variable based on two non-interacting continuous variables [duplicate]

I want to simulate a binary response variable which depends on two normally distributed continuous variables, and I want to have more 1s than 0s in the response variable. I wonder how this can be done ...
28 views

### How to simulate errors from any regression model? [duplicate]

I am trying to wrap my head around this: Other than a standard linear regression model, we almost never know the theoretical distributions of the error terms Thus, how do we simulate random errors ...
22k 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 ...
• 773
15k views

### Generate random correlated data between a binary and a continuous variable

I want to generate two variables. One is binary outcome variable (say success / failure) and the other is age in years. I want age to be positively correlated with success. For example there should be ...
• 7,261
18k views

### Generate data samples from Poisson regression

I was wondering how you would generate data from a Poisson regression equation in R? I'm kind of confused how to approach the problem. So if I assume we have two predictors $X_1$ and $X_2$ which are ...
• 2,471
10k views

### Simulating data for logistic regression with a categorical variable

I was trying to create some test data for logistic regression and I found this post How to simulate artificial data for logistic regression? It is a nice answer but it creates only continuous ...
• 243
2k views

### What exactly does a proper scoring rule want to do?

I will adapt an excellent simulation by our Stéphane Laurent for this question. ...
• 64.7k
3k views

### How to generate data for logistic regression with an independent variable that is not centred?

In this post, there is a script to generate data for a logistic regression. ...
• 1,235
339 views

### Linear probability model with crossentropy (log) loss

For better or for worse, some people shoehorn binary $y$ variables into an ordinary least squares linear regression. $$\mathbb E[Y\vert X]=\hat y=X\beta$$ If we encode the $y_i$ as either $0$ or $1$,...
• 64.7k
2k views

### Logistic regression - how to interpret my graph?

I evaluated a logistic regression using mnrfit function in Matlab. However, I am not sure if I did this correctly, because my graph does not looks like standard logistic regression. The image below ...
2k views

### Can I compare the output probabilities of two machine learning models?

I'm sorry if this is a silly question. Suppose there are two logistic regression models $M_1$ and $M_2$ trained on the same (or similar) dataset, and their outputs of given input $x$ are \$P_{M_1}(y \...
• 143
814 views

### receiver operating characteristic (ROC) on a test set

The following image definitely makes sense to me. Say you have a few trained binary classifiers A, B (B not much better than random guessing etc. ...) and a test set composed of n test samples to go ...
• 101
602 views

### Repeated measures with single measurements

I have the following situation: General practitionar (gp), patient (pat) and consultation (cons). Each gp has several patient and each patient can have 1 and more consultations with a specific ...
• 1,059