Description Usage Arguments Details Value See Also Examples

Calculate power and sample size for comparison of 2 proportions for both balanced and unbalanced designs.

1 2 3 | ```
prop_power(n, n1, n2, p1, p2, fraction = 0.5, alpha = 0.05,
power = NULL, alternative = c("two.sided", "one.sided"), odds.ratio,
percent.reduction, ...)
``` |

`n` |
total sample size. |

`n1` |
sample size in group 1. |

`n2` |
sample size in group 2. |

`p1` |
group 1 proportion. |

`p2` |
group 2 proportion. |

`fraction` |
fraction of total observations that are in group 1. |

`alpha` |
significance level/type 1 error rate. |

`power` |
desired power, between 0 and 1. |

`alternative` |
alternative hypothesis, one- or two-sided test. |

`odds.ratio` |
odds ratio comparing p2 to p2. |

`percent.reduction` |
percent reduction of p1 to p2. |

`...` |
further arguments passed to or from other methods. |

Power calculations are done using the methods described in 'stats::power.prop.test', 'Hmisc::bsamsize', and 'Hmisc::bpower'.

a list with class "prop_power" containing the following components:

`n` |
the total sample size |

`n1` |
the sample size in group 1 |

`n2` |
the sample size in group 2 |

`p1` |
the proportion in group 1 |

`p2` |
the proportion in group 2 |

`power` |
calculated or desired power |

`sig.level` |
level of significance |

[stats::power.prop.test], [Hmisc::bsamsize], [Hmisc:bpower]

1 2 3 4 | ```
prop_power(n = 220, p1 = 0.35, p2 = 0.2)
prop_power(p1 = 0.35, p2 = 0.2, fraction = 2/3, power = 0.85)
prop_power(p1 = 0.35, n = 220, percent.reduction = 42.857)
prop_power(p1 = 0.35, n = 220, odds.ratio = 0.4642857)
``` |

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.