n1.get.solution {exact.n} | R Documentation |
Find minimal n1 achieving target power for range of values of p0
Description
This function calls n1.get.vector, runs if for all values of p0 within the supplied range and then takes the worst (i.e. largest) solution for n1
Usage
n1.get.solution(data, beta, p0, delta, alpha, type = 1)
Arguments
data |
power database for selected value of alpha and delta |
beta |
scalar target for power |
p0 |
single value or range of values for baseline probability |
delta |
value of clinically relevant difference |
alpha |
value of nominal size of test |
type |
type of minimum solution (See details) |
Value
vector of solutions for n1 with name vector equal to range of n0 values
Author(s)
Chris J. Lloyd
References
C.J. Lloyd (2022) Exact samples sizes for clinical trials subject to size and power constraints. Preprint. doi:10.13140/RG.2.2.11828.94085
Examples
# Load toy version of power library for alpha=0.025, delta=0.20.
rdata_file = system.file('files', 'LIB.a025.d20.Rdata', package = 'exact.n')
load(rdata_file)
# n0 solutions when p0=0.5
n1.get.solution(LIB.a025.d20,beta=.7,p0=0.5,delta=0.2,alpha=0.025,type=1)
# n0 solutions for p0 between 0.4 ad 0.5
n1.get.solution(LIB.a025.d20,beta=.7,p0=c(0.4,0.5),delta=0.2,alpha=0.025,type=1)
[Package exact.n version 1.1.1 Index]