Tidy summarizes information about the components of a model. A model component might be a single term in a regression, a single hypothesis, a cluster, or a class. Exactly what tidy considers to be a model component varies across models but is usually self-evident. If a model has several distinct types of components, you will need to specify which components to return.
A epi.2by2
object produced by a call to epiR::epi.2by2()
Return measures of association (moa
) or test statistics (stat
),
default is moa
(measures of association)
Additional arguments. Not used. Needed to match generic
signature only. Cautionary note: Misspelled arguments will be
absorbed in ...
, where they will be ignored. If the misspelled
argument has a default value, the default value will be used.
For example, if you pass conf.lvel = 0.9
, all computation will
proceed using conf.level = 0.95
. Additionally, if you pass
newdata = my_tibble
to an augment()
method that does not
accept a newdata
argument, it will use the default value for
the data
argument.
The tibble has a column for each of the measures of association
or tests contained in massoc
or massoc.detail
when epiR::epi.2by2()
is called.
A tibble::tibble()
with columns:
Upper bound on the confidence interval for the estimate.
Lower bound on the confidence interval for the estimate.
Degrees of freedom used by this term in the model.
The two-sided p-value associated with the observed statistic.
The value of a T-statistic to use in a hypothesis that the regression term is non-zero.
The name of the regression term.
Estimated measure of association
# feel free to ignore the following line—it allows {broom} to supply
# examples without requiring the model-supplying package to be installed.
if (requireNamespace("epiR", quietly = TRUE)) {
# load libraries for models and data
library(epiR)
# generate data
dat <- matrix(c(13, 2163, 5, 3349), nrow = 2, byrow = TRUE)
rownames(dat) <- c("DF+", "DF-")
colnames(dat) <- c("FUS+", "FUS-")
# fit model
fit <- epi.2by2(
dat = as.table(dat), method = "cross.sectional",
conf.level = 0.95, units = 100, outcome = "as.columns"
)
# summarize model fit with tidiers
tidy(fit, parameters = "moa")
tidy(fit, parameters = "stat")
}
#> Package epiR 2.0.46 is loaded
#> Type help(epi.about) for summary information
#> Type browseVignettes(package = 'epiR') to learn how to use epiR for applied epidemiological analyses
#>
#> # A tibble: 3 × 4
#> term statistic df p.value
#> <chr> <dbl> <dbl> <dbl>
#> 1 chi2.strata.uncor 8.18 1 0.00424
#> 2 chi2.strata.yates 6.85 1 0.00885
#> 3 chi2.strata.fisher NA NA 0.00635