uniroot.integer.mod | R Documentation |
A modified integer-based root-finding algorithm for determining the sample size required to achieve a target power. This function extends the uniroot integer search method to handle cases with stepwise power searches while considering constraints on search limits.
uniroot.integer.mod(
f,
power,
lower = lower,
upper = upper,
step.power = step.power,
step.up = step.up,
pos.side = pos.side,
maxiter = maxiter,
...
)
f |
Function for which a root is needed. |
power |
Numeric. Target power value. |
lower |
Integer. Minimum allowable root value. |
upper |
Integer. Maximum allowable root value. |
step.power |
Numeric. Initial step size defined as |
step.up |
Logical. If |
pos.side |
Logical. If |
maxiter |
Integer. Maximum number of iterations allowed. |
... |
Additional arguments passed to |
A list containing:
root
The integer value closest to the root on the correct side.
f.root
Value of f
at the estimated root.
iter
Number of function evaluations performed.
table.iter
A data frame showing estimated sample size (N
) and corresponding power at each iteration.
table.test
A data frame containing endpoint-level test results for each simulation and corresponding N
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.