Skip to contents

Standard broom::tidy() and broom::glance() interfaces for an object returned by table_outcome().

Usage

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

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

Arguments

x

A spicy_outcome_table returned by table_outcome().

...

Ignored, for S3 compatibility.

Value

A tbl_df (or data.frame when tibble is not installed).

Details

tidy() returns the DESCRIBED rows: the marginal Overall row and one row per (grouping x level). Columns: outcome (the outcome name, constant down the frame), variable (the grouping, or the outcome itself on the marginal row), label, level (NA on the marginal row), .row_role ("summary" on the marginal row, "missing" on the row of missing values the table adds, "level" otherwise), estimate (the mean), std.error (sd / sqrt(n)), conf.low, conf.high, n, weighted_n (the sum of the weights, NA without weights), median, q1, q3, min, max, sd: the statistics of tidy.spicy_continuous_table().

Two identity columns where the sibling has one, and deliberately: here the outcome is fixed and the variable changes, so a single outcome column would have to mean two different things down the frame. The schema reads without knowing which function produced it.

glance() returns one row per grouping – one BLOCK – with that block's own comparison. Columns: outcome, variable, label, n_levels, test_type, statistic, df, df.residual, p.value, es_type, es_value, es_ci_lower, es_ci_upper, nobs (the rows of the block's levels, a row of zero weight left out), weighted_nobs (the sum of their weights, NA without weights). Index by NAME rather than by position.

n_levels counts the levels the TABLE displays, so a missing-value display level counts; the comparison behind test_type runs on the observed levels only, as it does everywhere in the family.