Description Usage Arguments Details Value See Also Examples

View source: R/nicqFunctions.R

Function gives power (if n1=NULL) or sample size (if power=NULL). Assumes no ties.

1 2 3 4 5 |

`n1` |
sample size of control group, calculated if NULL |

`n2` |
sample size of test group. If n1=NULL, n2 is ignored and calculated based on power and n2.over.n1. If power=NULL, then n2=ceiling(n2.over.n1*n1). |

`power` |
power under galt, calculated if NULL |

`sig.level` |
significance level |

`n2.over.n1` |
ratio of sample sizes |

`q` |
probability associated with control quantile of interest |

`delta0` |
difference in proportions at control quantile of interest |

`alternative` |
alternative hypothesis direction, 'less' means F2(t) less than gnull(F1(t)) for some t. |

`gnull` |
variable margin function under null hypothesis (more formally, at the boundary between the null and alternative hypotheses for the pre-specified hypotheses) |

`galt` |
variable margin function for which we calculate the power |

`minn` |
minimum value for sample size for n1, input into |

`maxn` |
maximum value for sample size for n1, input into |

`...` |
extra arguments passed to |

The function either calculates the power (if n1=NULL) or calculates n1 and n2 (if power=NULL). In the latter case,
we use `uniroot.integer`

to find the smallest n1
that gives power at least as large as the given power [with n2 defined as ceiling(n2.over.n1*n1)].

a `power.htest`

object. A list with elements:

`n1` |
sample size for control group |

`n2` |
sample size for test group |

`delta0` |
F2(tau)-F1(tau), with tau defined by F1(tau)=q |

`q` |
probability associated with tau |

`sig.level` |
significance level |

`power` |
power under galt |

`method` |
character description of method |

1 2 3 4 5 6 7 8 9 | ```
# to calculate power, leave power=NULL and supply n1 and n2
powerNicqTest(n1=200,n2=300)
# or supply n1 and n2.over.n1
powerNicqTest(n1=200,n2.over.n1=3/2)
## to calculate n1 and n2, supply power
## find minimum n1 that have power greater than 0.80
## takes 13 iterations to find n1=346
## so do not run it here
#powerNicqTest(power=.80,print.steps=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.