bucss_tidiers: Tidy and Summarize a Bias and Uncertainty Corrected Sample...

bucss_tidiersR Documentation

Tidy and Summarize a Bias and Uncertainty Corrected Sample Size Result

Description

tidy() returns the compact estimate view, as the sibling package DMAR's sample size planners do: one row with term ("sample_size"), estimate (the necessary sample size in the design's unit, which the result's sample_size_unit attribute names), and power (the power of the plan the result reports; see actual_power on the planner's help page). glance() returns the one-row wide view: the same three columns, then one column per row of the result, namely the sample size row, total_N where applicable, actual_power, ncp_adjusted, the planning effect size (the row whose name ends in _planning, such as smd_planning), and every echoed planning input, together with the design, the effect tested, the unit, the planned test's degrees of freedom where the design has them, and the assurance ceiling.

Usage

## S3 method for class 'bucss_plan'
tidy(x, ...)

## S3 method for class 'bucss_plan'
glance(x, ...)

Arguments

x

An object of class bucss_plan returned by an ss_buc_* function.

...

Ignored.

Details

These methods come from the generics package and need no extra setup; the verbs are re-exported by BUCSS, so tidy(result) and glance(result) work as soon as the package is loaded. The result is also an ordinary data.frame, so the long view and the stored full precision values remain available directly, for example result$value[result$term == "ncp_adjusted"].

Value

A one-row data.frame. For tidy(), the columns term, estimate, and power. For glance(), the wide summary described above. Both stop with an explanation if the object no longer has the shape of a single plan (for example, several plans stacked with dplyr::bind_rows(), or a plan with a row removed by dplyr::filter(); both keep the class).

Author(s)

Ken Kelley (kkelley@nd.edu) and Samantha F. Anderson (samantha.f.anderson@asu.edu)

Examples

result <- ss_buc_factorial_anova(F_observed = 5, N = 120, levels_A = 2,
  levels_B = 3, effect = "factor_B")

# Compact estimate view, as in DMAR: the sample size and its power.
tidy(result)
tidy(result)$estimate

# One-row wide view: every quantity and echoed input as a column.
glance(result)
glance(result)$total_N


BUCSS documentation built on Oct. 14, 2026, 1:07 a.m.