Learn R Programming

MRTSampleSizeBinary

This package provides a sample size calculator for Micro-randomized Trials with binary outcomes, based on the following article. Cohn, E. R., Qian, T., & Murphy, S. A. (2023). Sample size considerations for micro‐randomized trials with binary proximal outcomes. Statistics in Medicine.

Before using the calculator the user should have knowledge of the following:

  1. Study Setup

The number of decision time points and the randomization probability, i.e. the probability of assigning the treatment at each decision time point.

  1. Availability

Treatment can only be provided when an individual is available. The expected availability is the probability a person is available to receive the intervention at the decision times. You need to select a time-varying pattern for the expected availability.

  1. Success Probability Null Curve

The Success Probability Null Curve at each decision time point is defined as the probability of the proximal outcome equal to 1 for available individuals who are not assigned treatment. You need to provide the trend of success probability null curve.

  1. Proximal Treatment Effect

The Proximal Treatment Effect at each decision time point is defined as the mean difference in the proximal outcome between available people who are assigned a treatment versus available people who are not assigned treatment. In this work, we only consider the binary treatment. You need to provide the trend of proximal treatment effects.

The outputs one can get using this package are mainly two values, power and sample size. In both cases, you will need to input the desired significance level.

Copy Link

Version

Install

install.packages('MRTSampleSizeBinary')

Monthly Downloads

235

Version

0.1.2

License

GPL-3

Maintainer

Tianchen Qian

Last Published

December 3rd, 2023

Functions in MRTSampleSizeBinary (0.1.2)

compute_m_sigma

Computes "M" and "Sigma" matrices for the sandwich estimator of variance-covariance matrix.
power_summary

Calculate sample size at a range of power levels.
p_t_1

A vector of randomization probabilities for each time point.
m_matrix_1

An example matrix for "bread" of sandwich estimator of variance.
is_full_column_rank

Check if a matrix is full column rank.
min_samp

Compute minimum sample size.
tau_t_1

Vector that holds the average availability at each time point.
compute_ncp

Computes the non-centrality parameter for an F distributed random variable in the context of a MRT with binary outcome.
mrt_binary_ss

Calculate sample size for binary outcome MRT
mrt_binary_power

Calculate power for binary outcome MRT
power_vs_n_plot

Returns a plot of power vs sample size in the context of a binary outcome MRT. See the vignette for more details.
f_t_1

A matrix defining the MEE under the alternative hypothesis.
g_t_1

A matrix defining the success probability null curve.
sigma_matrix_1

An example matrix for "meat" of sandwich estimator of variance.
alpha_1

Vector that defines the success probability null curve.
max_samp

Returns default maximum sample size to end power_vs_n_plot().
beta_1

Vector that defines the MEE under the alternative hypothesis.