dot-power_count_serial.RdEstimate power for count-rate equivalence
.power_count_serial(
n_per_arm,
rate_test,
rate_reference,
exposure = 1,
margin_lower = 0.8,
margin_upper = 1.25,
model = c("poisson", "negative-binomial"),
dispersion = 0.1,
alpha = 0.05,
nsim = 5000,
seed = NULL,
design = c("parallel", "2x2"),
k = NULL,
endpoint_corr = NULL,
type_y = NULL,
adjust = c("none", "bonferroni", "sidak", "t", "pc", "partial-conjunction",
"partial_conjunction", "sequential"),
sigmaB = 0,
Eper = c(0, 0),
Eco = c(0, 0),
dropout = c(0, 0),
type_y_active = FALSE
)Subjects per arm.
Event rate in the test arm.
Event rate in the reference arm.
Exposure per subject; a scalar or one value per endpoint.
Lower rate-ratio margin; a scalar or one value per endpoint.
Upper rate-ratio margin; a scalar or one value per endpoint.
Count model: "poisson" or "negative-binomial".
Positive negative-binomial dispersion parameter. The
per-subject negative-binomial size is 1 / dispersion; parallel-arm
totals use size n / dispersion.
One-sided significance level.
Number of simulations.
Optional random seed.
Trial design: "parallel" or "2x2". For "2x2",
n_per_arm is interpreted as subjects per sequence.
Number of endpoints that must demonstrate equivalence. Defaults to all supplied endpoints.
Endpoint correlation matrix used by the Gaussian copula for multi-endpoint count simulations. The default is independence.
Numeric endpoint hierarchy used with adjust = "seq": 1
for primary/co-primary endpoints and 2 for secondary endpoints. Named
vectors are recommended when endpoint names are available.
Multiplicity adjustment for endpoint-wise one-sided alpha:
"none", "bonferroni", "sidak", "t", or "seq"/"sequential".
The "t" option uses Mielke's strong k-out-of-m calibration
alpha / (m - k + 1); legacy partial-conjunction labels are accepted.
Sequential testing applies the same primary-gate/secondary-family rule as
the continuous kernels.
When k equals the number of supplied endpoints, endpoint-wise adjustment
is not necessary for the all-endpoints-required intersection-union decision;
the requested method is retained but a warning is issued.
Between-subject standard deviation on the log-rate scale for
the count 2x2 design.
Numeric vector of length 2 containing period effects on the log-rate scale.
Numeric vector of length 2 containing carry-over effects on the log-rate scale, ordered as reference carry-over and treatment carry-over.
Numeric vector of length 2 containing dropout proportions for the two crossover sequences.
Internal flag indicating whether type_y is active.
An object of class countpower containing estimated power and its
binomial confidence interval.
For design = "2x2", complete participants contribute one count
under each treatment. The kernel analyzes within-participant log-rate
contrasts, averages the two sequence-specific estimates to remove period
effects, and applies the carry-over correction implied by
Eco = c(reference_carryover, treatment_carryover). exposure is used as
the log-rate offset. sigmaB is the standard deviation of a subject
random intercept used in the count-generating model; it cancels from the
within-participant treatment contrast. The standard error is estimated from
the empirical variance of the subject-level contrasts. Participants who
drop out before completing both periods do not contribute to this paired
analysis.
SimTOST:::power_count(40, 0.20, 0.20, nsim = 100, seed = 1)
#> Count-rate equivalence power
#> Model: poisson
#> Design: parallel
#> Subjects per arm: 40
#> Endpoints: 1 (required: 1 )
#> Alpha adjustment: none
#> Power: 0.0000 [0.0000, 0.0461]