versus: Compare and Summarize Trial Planning Objects

%vs%R Documentation

Compare and Summarize Trial Planning Objects

Description

Combines two operands with getComparison() and returns the summary of the resulting comparison. Repeated use extends the summarized comparison.

Usage

x %vs% y

Arguments

x, y

Supported trial planning objects, their SummaryFactory summaries, TrialComparison objects, or TrialComparisonSummary objects.

Details

Summary operands contribute their underlying object. For ParameterSet operands, the supported classes are those accepted by getComparison(): designs, design characteristics, sample size or power plans, simulations, and power/ASN results, event probabilities, recruitment results, conditional power, performance scores, Fisher information, and optimal conditional-error characteristics. Existing comparisons contribute their contained objects in order, retaining names and references. The operands' collection membership is not modified. The validation and unique-name rules of getComparison() apply.

The result can be assigned, extended with another ⁠%vs%⁠, or passed directly to plot.TrialComparison(). Chained operations do not print intermediate summaries. Plot axes must still be specified when their selection is ambiguous.

Value

A visible TrialComparisonSummary, as returned by summary(getComparison(x, y)) after unwrapping summary operands.

See Also

getComparison(), compare()

Examples

comparison <- getSampleSizeMeans(alternative = 0.22, stDev = 0.5) %vs%
    getSampleSizeMeans(alternative = 0.44, stDev = 1) %vs%
    getSampleSizeMeans(alternative = 0.59, stDev = 1)
comparison

comp1 <- getSampleSizeMeans(alternative = 0.22) %vs%
    compare(getSampleSizeMeans(alternative = 0.44))
comp2 <- comp1 %vs% compare(getSampleSizeMeans(alternative = 0.59))
comp2
comp2 |> getComparison()

## Not run: 
getSampleSizeMeans(alternative = 0.22, stDev = 0.5) %vs%
    getSampleSizeMeans(alternative = 0.44, stDev = 1) %vs%
    getSampleSizeMeans(alternative = 0.59, stDev = 1) |>
    plot(
        xAxis = "alternative",
        yAxis = c("nFixed", "criticalValuesEffectScale"), category = "stDev"
    )

## End(Not run)


rpact documentation built on Nov. 17, 2026, 1:07 a.m.