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

View source: R/ms.varexplore.R

ms.varexploreR Documentation

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)

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.

Value

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

Examples

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

powertools documentation built on April 4, 2025, 5:02 a.m.