Tidy a matchatr contrast result

Description

Returns the contrasts carried by a matchatr_result as a tidy data.table, one row per reported contrast, with the contrast scale recorded in a type column.

Usage

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

Arguments

x A matchatr_result object returned by contrast().
Unused; present for generic consistency.

Value

A data.table with columns term, estimate, std.error, type, conf.low, conf.high.

See Also

contrast()

Other tidiers: tidy.matchatr_fit(), tidy.matchatr_homogeneity()

Examples

library("matchatr")

set.seed(1)
df <- data.frame(case = rep(c(1, 0), each = 100), x = rbinom(200, 1, 0.4))
fit <- matcha(df, outcome = "case", exposure = "x", design = unmatched_cc())
tidy(contrast(fit, type = "or"))
     term estimate std.error   type  conf.low conf.high
   <char>    <num>     <num> <char>     <num>     <num>
1:      x 1.131579  0.324955     or 0.6445338  1.986662