Learn R Programming

powertools (version 1.0.0)

ms.varexplore: Variance exploration for a multisite trial with a binary outcome

Description

This function can be used to help select a plausible value for the variance/SD of the random intercept for site in a multisite trial with a binary outcome. Based on user-supplied values of the outcome proportions in the two conditions, this function outputs, for a range of possible values of the SD, the intervals within which we expect about 95% of the site-specific odds ratios to lie.

Usage

ms.varexplore(pc, pt, print = TRUE)

Value

A list containing the calculated OR and a dataframe of outputs.

Arguments

pc

The probability of the outcome in control clusters.

pt

The probability of the outcome in treatment clusters.

print

Whether or not to print the results in a table; defaults to TRUE. To retrieve the results even when print = FALSE, assign the function output to an object.

Details

In a multisite trial design, participants are randomized to conditions within site. The use of this function is illustrated in Crespi CM (2025) Power and Sample Size in R.

Examples

Run this code
ms.varexplore(pc = 0.1, pt = 0.2)
output <- ms.varexplore(pc = 0.1, pt = 0.2, print = FALSE)
output$OR

Run the code above in your browser using DataLab