Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/powerMediation.R

Calculate sample size for testing slope for simple linear regression based on R2.

1 2 3 4 5 6 | ```
ss.SLR.rho(power,
rho2,
n.lower = 2.01,
n.upper = 1e+30,
alpha = 0.05,
verbose = TRUE)
``` |

`power` |
power. |

`rho2` |
square of the correlation between the outcome and the predictor. |

`n.lower` |
lower bound of the sample size. |

`n.upper` |
upper bound o the sample size. |

`alpha` |
type I error rate. |

`verbose` |
logical. |

The test is for testing the null hypothesis *λ=0*
versus the alternative hypothesis *λ\neq 0*
for the simple linear regressions:

*
y_i=γ+λ x_i + ε_i, ε_i\sim N(0, σ^2_{e})
*

`n ` |
sample size. |

`res.uniroot ` |
results of optimization to find the optimal sample size. |

The test is a two-sided test. For one-sided tests, please double the
significance level. For example, you can set `alpha=0.10`

to obtain one-sided test at 5% significance level.

Weiliang Qiu stwxq@channing.harvard.edu

Dupont, W.D. and Plummer, W.D..
Power and Sample Size Calculations for Studies Involving Linear Regression.
*Controlled Clinical Trials*. 1998;19:589-601.

`minEffect.SLR`

,
`power.SLR`

,
`power.SLR.rho`

,
`ss.SLR`

.

1 | ```
ss.SLR.rho(power=0.8, rho2=0.6, alpha = 0.05, verbose = TRUE)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.