# logistic regression sample size calculation

I m trying to find if parental involvement can positively impact student's 4 year graduation rate. My target variable is student's graduation (yes / no) Main independent variable is whether parent attended first year orientation(yes / no) I am also considering other independent variables as sex, in/out of state, admitted time, major..etc.

In this case, how can I calculate sample size?

1. Should I decide variables first or calculate sample size first?
2. Some equation include Odds ration in sample size calculation, but how can I know my OR at this point?
3. Do I have to complete collecting sample data and run some test(normality.. or whatever) in order to have all ingredients for calculating sample size? - I have to request student data to univ department, that is why I am trying to get sample size before I send data request.

Please give me simple and clear explanation. Sadly, I won't be understand any theoretical statistics reasoning behind sample size equation.....

• Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
– Community Bot
Oct 29, 2022 at 0:24

Should I decide variables first or calculate sample size first?

You should decide on the variables you're going to study first. Partly because the correlation of the other variables with the variable of interest will play a part in the sample size calculation.

Some equation include Odds ration in sample size calculation, but how can I know my OR at this point?

When you do a sample size calculation, you design the study to have a pre-specified statistical power to detect a smallest odds ratio of interest. If the true odds ratio is bigger, perfect you have additional power to detect.

Do I have to complete collecting sample data and run some test(normality.. or whatever) in order to have all ingredients for calculating sample size? - I have to request student data to univ department, that is why I am trying to get sample size before I send data request.

No need to have data in hand, but it helps.

Now, onto the calculation.

According to this book (second edition, pg. 195) the sample size formula for logistic regression is

$$n = \dfrac{(z_{1-\alpha/2} + z_{\gamma})^2}{(\beta\sigma_x)^2p(1-p)(1-\rho^2)}$$

Where

• $$z_{1-\alpha/2}$$ is the $$1-\alpha/2$$ percentile of a standard normal. If you use $$\alpha=0.05$$ then $$z_{1-\alpha/2} \approx 1.96$$

• $$\gamma$$ is the desired power level and $$z_\gamma$$ the $$\gamma^{th}$$ quantile of a standard normal. If you use 80% power then $$z_\gamma \approx 0.84$$

• $$\beta$$ is the smallest log odds ratio of interest. Note I said LOG odds ratio.

• $$\sigma_x$$ is the standard deviation of the predictor you're studying. Since the variable is binary (attended orientation, did not attend orientation) then this is going to be $$\sqrt{f(1-f)}$$, where $$f$$ is the fraction of the sample who had their parents come to orientation. This just requires an educated guess, no need for this to be perfect.

• $$p$$ is the marginal prevalence of fourth year graduation.

• $$\rho^2$$ is the $$R^2$$ from a linear regression where the outcome is "Parent attended orientation" and the predictors are the other variables in your model. This is the hardest to pin down. Just try to think about how well correlated the predictor of interest is to the other variables.

Without any information on the proportion of students graduating, or the proportion of parents who come to orientation, I can't really help much further.

• (I will happy +1 this when there is mention to the book name and the relevant chapter & page. I dislike it when people generally mention "book X" because going through hundreds of pages to find the referred passage is often very counterproductive. For the record, I checked the book and I cannot find this formula - but that book is exceptional and my search potential imperfect.) Oct 29, 2022 at 2:21
• @usεr11852. See the end of the logistic regression chapter. The final section should be sample size calculations. I don't have a page reference right now Oct 29, 2022 at 5:56
• it's not there I am afraid. (Assuming you refer to Chapter 6) Oct 29, 2022 at 12:40
• @usεr11852 Here is a screenshot of the formula. I'm not sure if we're looking at the same book, but it is most certainly there. Oct 29, 2022 at 12:51
• Here is a link to the book I'm looking at. Oct 29, 2022 at 12:53