ris {RTSA} | R Documentation |
Calculate required sample and trials size.
Description
Calculate required sample and trials size.
Usage
ris(
outcome,
mc,
side = 2,
alpha = 0.05,
beta = 0.1,
fixed = TRUE,
sd_mc = NULL,
pC = NULL,
p1 = NULL,
ma = NULL,
tau2 = NULL,
I2 = NULL,
D2 = NULL,
type = "prospective",
trials = NULL,
RTSA = FALSE,
...
)
Arguments
outcome |
Choose between: "MD" (mean difference), "RR" (relative risk), "OR" (odds ratio) or "RD" (risk difference). |
mc |
Minimum clinical relevant effect. For "OR" or "RR" set to natural scale, not log scale. |
side |
Test type. Set to 1 or 2 depending on the test being 1- or 2-sided. |
alpha |
The level of type I error as a percentage, the default is 0.05 corresponding to 5%. |
beta |
The level of type II error as a percentage, the default is 0.1 corresponding to 10%. |
fixed |
Should sample size be based on a fixed-effect (TRUE) or random-effects (FALSE) model. Defaults to TRUE. |
sd_mc |
Standard deviation of estimated effect. Only needed when outcome type is "MD". |
pC |
Probability of event in control group. Only needed when outcome type is "OR", "RR" or "RD". |
p1 |
Probability of event in treatment group. Only needed when outcome type is "RD". |
ma |
An optional |
tau2 |
The value of the heterogeneity. Use when estimating the sample size under a random effects model. If data is provided, the estimated heterogeneity is used instead. |
I2 |
Optional argument. Inconsistency. |
D2 |
Optional argument. Diversity. |
type |
Whehter the type of calculaiton is for "prospective" meta-analysis or "retrospective" meta-analysis. If the type is retrospective, one should add a meta-analysis object to the function. See argument ma. |
trials |
Optional numeric argument. If one is interested in a specific number of trials. |
RTSA |
Whether the ris function was called via the RTSA function. Purely operational argument. |
... |
additional arguments |
Value
A list of up to 6 elements:
settings |
A list containing the arguments provided to the |
NF |
The total number of required participants in a fixed-effect meta-analysis if type is prospective. Contains a list if the type is retrospective, where |
NR_tau |
A list containing: |
NR_D2 |
The total number of required participants in a random-effects meta-analysis adjusted by diversity ( |
NR_I2 |
The total number of required participants in a random-effects meta-analysis adjusted by inconsistency ( |
Examples
# Sample and trial size calculation for prospective meta-analysis
ris(outcome = "RR", mc = 0.8, pC = 0.12, fixed = TRUE, alpha = 0.05,
beta = 0.1, side = 2)
# Additional sample and trial size calculation for retrospective meta-analysis
# It is calculated directly from the metaanalysis() function
data("perioOxy")
ma <- metaanalysis(outcome = "RR", data = perioOxy, mc = 0.8, beta = 0.2)
ma$ris
# Or by using the two functions in sequence
ma <- metaanalysis(outcome = "RR", data = perioOxy)
ris(outcome = "RR", mc = 0.8, ma = ma, type = "retrospective", fixed = FALSE,
beta = 0.2, alpha = 0.05, side = 2)