Linked Questions

5 votes
1 answer

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 ...
Luca Dibo's user avatar
0 votes
1 answer

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 ...
CookieCrusher's user avatar
0 votes
0 answers

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 ...
Uk rain troll's user avatar
64 votes
1 answer

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 ...
Dcook's user avatar
  • 773
25 votes
3 answers

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 ...
user333's user avatar
  • 7,261
19 votes
2 answers

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 ...
Michael's user avatar
  • 2,471
14 votes
1 answer

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 ...
user1301295's user avatar
8 votes
3 answers

What exactly does a proper scoring rule want to do?

I will adapt an excellent simulation by our Stéphane Laurent for this question. ...
Dave's user avatar
  • 64.7k
2 votes
1 answer

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. ...
M. Beausoleil's user avatar
3 votes
3 answers

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$,...
Dave's user avatar
  • 64.7k
0 votes
1 answer

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 ...
user122618's user avatar
2 votes
2 answers

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 \...
Ze-Nan Li's user avatar
  • 143
0 votes
3 answers

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 ...
valentin's user avatar
  • 101
7 votes
3 answers

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 ...
giordano's user avatar
  • 1,059
4 votes
1 answer

Simulating potential outcomes with a binary outcome

I want to create some simple simulations of potential outcomes to explore issues of confounding. I start with a binary confounder X and a binary treatment A. When my outcome is continuous, I can ...
RuthQuinn's user avatar

15 30 50 per page