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

View source: R/powerMediation.R

Calculate minimal detectable slope given sample size and power for simple linear regression.

1 2 3 4 5 6 | ```
minEffect.SLR(n,
power,
sigma.x,
sigma.y,
alpha = 0.05,
verbose = TRUE)
``` |

`n` |
sample size. |

`power` |
power for testing if |

`sigma.x` |
standard deviation of the predictor |

`sigma.y` |
marginal standard deviation of the outcome |

`alpha` |
type I error rate. |

`verbose` |
logical. |

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

*
y_i=gamma+lambda x_i + epsilon_i, epsilon_i ~ N(0, sigma^2_{e})
*

`lambda.a ` |
minimum absolute detectable effect. |

`res.uniroot ` |
results of optimization to find the optimal minimum absolute detectable effect. |

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.

`power.SLR`

,
`power.SLR.rho`

,
`ss.SLR`

,
`ss.SLR.rho`

.

1 2 | ```
minEffect.SLR(n = 100, power = 0.8, sigma.x = 0.2, sigma.y = 0.5,
alpha = 0.05, verbose = TRUE)
``` |

```
[1] 0.68071
```

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.