power.2m.111: Budget and/or sample size, power, MDES calculation for MRTs...

View source: R/power.2m.111.R

power.2m.111R Documentation

Budget and/or sample size, power, MDES calculation for MRTs investigating mediation effects with individual-level mediators

Description

This function can calculate required budget for desired power and power under a fixed budget for multisite-randomized trials (MRTs) with individual mediators probing mediation effects. It also can perform conventional power analyses (e.g., required sample size and power calculation).

Usage

power.2m.111(
  cost.model = TRUE,
  expr = NULL,
  constraint = NULL,
  sig.level = 0.05,
  two.tailed = TRUE,
  a = NULL,
  b = NULL,
  power = NULL,
  m = NULL,
  test = NULL,
  n = NULL,
  p = NULL,
  c1 = NULL,
  c1t = NULL,
  c2 = NULL,
  r12 = 0,
  r22m = 0,
  r12m = 0,
  icc.m = NULL,
  omega = NULL,
  icc = NULL,
  J = NULL,
  q = 0,
  q.a = 0,
  q.b = 0,
  max.iter = 300,
  powerlim = NULL,
  Jlim = NULL,
  mlim = NULL,
  rounded = TRUE
)

Arguments

cost.model

Logical; power analyses accommodating costs and budget (e.g., required budget for desired power, power/MDES under fixed budget) if TRUE, otherwise conventional power analyses (e.g., required sample size, power, or MDES calculation); default value is TRUE.

expr

returned object from function od.2m.111; default value is NULL; if expr is specified, parameter values of a, b, c1, c1t, and p used or solved in function od.2m.111 will be passed to the current function; only the values of p and n that specified or solved in function od.2m.111 can be overwritten if constraint is specified.

constraint

specify the constrained value of p and/or n in a list format to overwrite that/those from expr; default value is NULL.

sig.level

Significance level or type I error rate, default value is 0.05.

two.tailed

Logical; two-tailed tests if TRUE, otherwise one-tailed tests; default value is TRUE.

a

The treatment effect on the mediator.

b

The within treatment correlation between the outcome and the mediator.

power

Statistical power.

m

Total budget.

test

The type of test will be used to detect mediation effects. Default is the joint significance test (i.e., test = "joint"). Another choice is the Sobel test by specifying the argument as test = "sobel".

n

The level-1 sample size per level-2 unit.

p

The proportion of level-1 units to be assigned to treatment.

c1

The cost of sampling one level-1 unit in control condition.

c1t

The cost of sampling one level-1 unit in treatment condition.

c2

The cost of sampling one level-2 unit.

r12

The proportion of level-1 variance explained by covariates.

r22m

The proportion of variance of site-specific treatment effect explained by covariates.

r12m

The proportion of within treatment mediator variance at the level one explained by covariates.

icc.m

The intraclass correlation coefficient for the mediator.

omega

The standardized variance of site-specific treatment effect.

icc

The unconditional intraclass correlation coefficient (ICC) in population or in each treatment condition.

J

The number of sites.

q

The number of covariates at level 2.

q.a

The number of covariates at the individual level of the mediator model (except the treatment indicator).

q.b

The number of covariates in the outcome model (except the treatment indicator and the mediator).

max.iter

Maximal number of function evaluations when used as the stopping criterion. Default is 200.

powerlim

The range for solving the root of power (power) numerically, default value is c(1e-10, 1 - 1e-10).

Jlim

The range for searching the root of level-2 sample size (J) numerically, default is c(4, 10e10).

mlim

the range for searching the root of budget (m) numerically, default value is the costs sampling nlim units.

rounded

Logical; round the values of p, n/J/K that are from functions od.4 to two decimal places and integer, respectively if TRUE, otherwise no rounding; default value is TRUE.

Value

Required budget (or required sample size), statistical power, or MDES depending on the specification of parameters. The function also returns the function name, design type, and parameters used in the calculation.


odr documentation built on Aug. 8, 2023, 5:13 p.m.