# Sample size estimation for regression coefficient

I am looking into the method to calculate the sample size if we would want the specific coefficient significantly different from zero. I have 4 independent variables and 1 dependent variable. And I have 50 observations so far. I would like to know how many more observations do I need to get one of the coefficients significant because it's trending.

I have read this paper from Ken Kelley and Scott E. Maxwell, "Sample Size for Multiple Regression: Obtaining Regression Coefficients That Are Accurate, Not Simply Significant". And they have this formula to estimate sample size.

$N = \Big(\frac{z_{(1-\alpha/2)}}{w}\Big)^2\Big(\frac{1-R^2}{1-R^2_{XX_j}}\Big) + p + 1$

where $R^2$ represents the population multiple correlation coefficient predicting the criterion (dependent) variable $Y$ from the $p$ predictor variables and $R^2_{XX_j}$ represents the population multiple correlation coefficient predicting the $j$th predictor from the remaining $p − 1$ predictors. The calculated $N$ should be rounded to the next larger integer for sample size. The $w$ in the above equation is the desired half-width of the confidence interval.

$R^2$ is easy to calculate. But I don't know how to calculate $R^2_{XX_j}$ for this. Do you guys have any idea?

• I've made a change to the first sentence ("4 dependent variables" -> "4 independent variables"). Please check that is correct. Nov 8, 2016 at 11:19
• Note that if you have already analysed your dataset you will need to take account of that in your sample size determination because you have already used up some of your alpha. Nov 8, 2016 at 13:35
• @mdewey what does it mean by used some of my alpha? Nov 9, 2016 at 3:15
• If you already did a test then you cannot re-test without taking account of the fact that you already did a test. The crudest way to do this is to do each at the 0.025 level to get a 0.05 but there are many other sophisticated ways to do this. Nov 9, 2016 at 21:13
• @Mdewey That's great! Can you please give me the name of the methods so i can research about that? Thank you so much! Nov 10, 2016 at 10:20

Strictly speaking, you run the same regression as if the $j$-th variable was your dependent variable (and you exclude that from your independent variables). The corresponding $R^2$ will be your $R^2_{XX_j}$. For instance, imagine you ran the following model:

# estimate main model:
mod <- lm(mpg ~ disp + drat + wt*qsec, data=mtcars)


and now you want $R^2_2$, which corresponds to disp. You can run

mod2 <- lm(disp ~ drat + wt*qsec, data=mtcars)
Rsq_disp <- summary(mod2)$r.squared Rsq_disp > 0.8933448  Note that$1/(1-R^2_{XX_j})$is also called the variance inflation factor of variable$j\$. See ??vif if you are using R. For instance, let's use the car package in R:

library(car)
# get variance inflation factors:
vif(mod)
disp       drat         wt       qsec    wt:qsec
9.376007   2.499659 455.406742  41.596850 428.288269


These numbers correspond to

$$\frac{1}{1-R^2_j}$$

To see this, note that

1/(1-Rsq_disp)
> 9.376007


You see that the number is identical to the first one obtained earlier with vif.