# Minimum number of observations for logistic regression?

I'm running a binary logistic regressions with 3 numerical variables. I'm suppressing the intercept in my models as the probability should be zero if all input variables are zero.

What's minimal number of observations I should use?

-
You would need an intercept of $-\infty$ to do that! An intercept of 0 corresponds to a probability of $\frac{1}{1 + \exp(-0)} = 1/2$, not $0$, when all independent variables are zero. –  whuber Jun 8 '11 at 18:57
There is a related discussion here: sample-size-for-logistic-regression. –  gung Dec 13 '12 at 14:18

There is one way to get at a solid starting point. Suppose there were no covariates, so that the only parameter in the model were the intercept. What is the sample size required to allow the estimate of the intercept to be precise enough so that the predicted probability is within 0.1 of the true probability with 95% confidence, when the true intercept is in the neighborhood of zero? The answer is n=96. What if there were one covariate, and it was binary with a prevalence of 0.5? One would need 96 subjects with x=0 and 96 with x=1 to have an upper bound on the margin of error for estimating Prob[Y=1 | X=x] not exceed 0.1. The general formula for the sample size required to achieve a margin of error of $\delta$ in estimating a true probability of $p$ at the 0.95 confidence level is $n = (\frac{1.96}{\delta})^{2} \times p(1-p)$. Set $p = 0.5$ for the worst case.

-

There isn't really a minimum number of observations. Essentially the more observations you have the more the parameters of your model are constrained by the data, and the more confident the model becomes. How many observations you need depends on the nature of the problem and how confident you need to be in your model. I don't think it is a good idea to rely too much on "rules of thumb" about this sort of thing, but use the all the data you can get and inspect the confidence/credible intervals on your model parameters and on predictions.

-

I wouldn't put much stock in rules of thumb either, but I've read ten data points per parameter as a cautious rule. So, 40 data points (30 for your variables, one for the intercept), unless you want interaction terms, in which case it would be more.

But really, it might make more sense to draw random samples based on your prior knowledge of the system and see for yourself how much data you would likely need for your particular problem. If you want to learn about a weak effect, you'll need much more data than if the answer is already staring you in the face after a few samples.

-

Update: I didn't see the above comment, by @David Harris, which is pretty much like mine. Sorry for that. You guys can delete my answer if it is too similar.

I'd second Dikran Marsupail post and add my two cents.

Take in consideration your prior knowledge about the effects that you expect from your independent variables. If you expect small effects, than you will need a huge sample. If the effects are expected to be big, than a small sample can do the job.

As you might know, standard errors are a function of sample size, so the bigger the sample size, the smaller the standard errors. Thus, if effects are small, i.e., are near zero, only a small standard error will be able to detect this effect, i.e, to show that it is significantly different from zero. On the other hand, if the effect is big (far from zero), than even a large standard error will produce significant results.

If you need some reference, take a look at Andrew Gelmans' Blog.

-
Gelman's blog is getting pretty big :-). Do you have a particular post in mind? –  whuber Jun 9 '11 at 14:06
@Whuber, you are right, I should have pointed to something more specific. He has some recent talk presentations about small effects and multiple comparisons, but I think the following link is enough: stat.columbia.edu/~gelman/research/published/power4r.pdf –  Manoel Galdino Jun 9 '11 at 21:45