Simulating population data for logistic regression model I want to simulate population data for logistic regression model. I have heard that i need to use something like monte carlo simulation but i have no clue about it. If someone has any idea about it it would be greatly helpful.
 A: A logistic regression model assumes that the data are binomial. If at least one of your variates are continuous (and you don't have replication) you'll want to generate Bernoulli observations (binomial $(n_i,p_i)$ with $n_i=1$).


*

*So given some overall sample size $n$, you set up the values taken by your predictor variables for each of those observations. You also need the $n_i$ for each case ( $= 1$ for many cases, but in some logistic regression situations $n_i>1$)

*You compute $p_i$ from your population parameter values and the values of the predictor variables for each observation:
a. $\eta_i = x_i\beta$  (where $x_i$ is the row-vector of predictors from row $i$ of $X$)
b. $p_i=1/(1+\exp(-\eta_i))$

*For each observation in the sample generate from a binomial$(n_i,p_i)$ (if $n_i=1$ this will just be a 0 or 1 of course. This is your response, $y_i$.
Those will give you a single simulated sample. You need to repeat step 3. as many times as you need samples for whatever you're doing.
