# Function to plan sample size so that the test of the squared multiple correlation coefficient is sufficiently powerful.

### Description

Function for determining the necessary sample size for the test of the squared multiple correlation coefficient or for determining the statistical power given a specified sample size for the squared multiple correlation coefficient in models where the regressors are regarded as fixed.

### Usage

1 2 3 |

### Arguments

`Population.R2` |
Population squared multiple correlation coefficient |

`alpha.level` |
Type I error rate |

`desired.power` |
desired degree of statistical power |

`p` |
the number of predictor variables |

`Specified.N` |
the sample size used to calculate power (rather than determine necessary sample size) |

`Cohen.f2` |
Cohen's (1988) effect size for multiple regression: |

`Null.R2` |
value of the null hypothesis that the squared multiple correlation will be evaluated against (this will typically be zero) |

`Print.Progress` |
if the progress of the iterative procedure is printed to the screen as the iterations are occuring |

`...` |
possible additional parameters for internal functions |

### Details

Determine the necessary sample size given a particular `Population.R2`

, `alpha.level`

, `p`

, and `desired.power`

. Alternatively, given `Population.R2`

, `alpha.level`

, `p`

, and `Specified.N`

, the function can be used to determine the statistical power.

### Value

`Sample.Size` |
returns either |

`Actual.Power` |
Actual power of the situation described |

### Note

When determining sample size for a desired degree of power, there will always be a slightly larger degree of actual power. This is the case because the algorithm employed determines sample size until the actual power is no less than the desired power (given sample size is a whole number power will almost certainly not be exactly the specified value). This is the same as other statistical power procedures that return whole numbers for necessary sample size.

### Author(s)

Ken Kelley (University of Notre Dame; KKelley@ND.Edu)

### See Also

`ss.aipe.R2`

, `ss.power.reg.coef`

, `conf.limits.ncf`

### Examples

1 2 3 4 5 | ```
# ss.power.R2(Population.R2=.5, alpha.level=.05, desired.power=.85, p=5)
# ss.power.R2(Cohen.f2=1, alpha.level=.05, desired.power=.85, p=5)
# ss.power.R2(Population.R2=.5, Specified.N=15, alpha.level=.05,
# desired.power=.85, p=5)
# ss.power.R2(Cohen.f2=1, Specified.N=15, alpha.level=.05, desired.power=.85, p=5)
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.