# Sample size for logistic regression with categorical independent variables [duplicate]

Trying to find a sample size for logistic regression I found a rule of thumb in http://www.medcalc.org/manual/logistic_regression.php

I cite:

Sample size considerations. Sample size calculation for logistic regression is a complex problem, but based on the work of Peduzzi et al. (1996) the following guideline for a minimum number of cases to include in your study can be suggested. Let p be the smallest of the proportions of negative or positive cases in the population and k the number of covariates (the number of independent variables), then the minimum number of cases to include is: N = 10 k / p If the resulting number is less than 100 you should increase it to 100 as suggested by Long (1997).

From:

Sample size for logistic regression?

I understand there are extra complexities like statistical power, stability and orthogonality of the variables.

But anyways, my question is if the fact that I have categorical variables would affect the sample needed. I ask this because for every level of a categorical variable you have one parameter.

More precisely, do I have to count every level of categorical variables as different variables to calculate sample size?

• yes, k could be replaced by degrees of freedom. – charles Nov 11 '14 at 19:23
• hope it is useful. people usually use "events per variable" but they mean "degrees of freedom per variable". Good luck! – charles Nov 12 '14 at 11:22