check_grain | R Documentation |
The check_grain()
function checks that a resistance outcome format
is specified, determines its grain and calls functions to validate the
grains' fields. See details for more information.
check_grain(timber)
timber |
A tibble of timber. |
The odds ratio (and its confidence intervals) are the universal measure of CEDAR and sawmill. A resistance outcome may be specified using the odds ratio directly, or by using a two-by-two table of counts or prevalences. sawmill supports four resistance outcome formats:
Contingency table
Prevalence table
Odds ratio
Risk ratio
There are two types of two-by-two tables supported by sawmill: contingency tables (containing count data), and prevalence tables (containing prevalence (
Contingency Table
AMR+ | AMR- | Total | |
Exposed | A | B | M1 |
Referent | C | D | M2 |
Prevalence Table
AMR+ | AMR- | Total | |
Exposed | P% | R% | M1 |
Referent | Q% | S% | M2 |
There are two types of measures of association supported by sawmill: odds ratios and risk ratios.
Odds Ratio
Lower CI | Odds Ratio | Upper CI | |
odds_lo | odds | odds_up | |
Risk Ratio
Lower CI | Risk Ratio | Upper CI | |
rratio_lo | rratio | rratio_up | |
A 'grain' is a set of fields from which we can derive an odds ratio and its confidence intervals. For tabular data, supported grains are a set of fields from which we can first compute a complete table of counts (A, B, C, D), then compute an odds ratio and its confidence intervals.
There are currently seven supported grains:
con_table_pos_neg: A, B, C, D
con_table_pos_tot: A, C, M1, M2
con_table_neg_tot: A, C, M1, M2
prev_table_pos_tot: P, Q, M1, M2
prev_table_neg_tot: R, S, M1, M2
odds_ratio: odds_ratio_lo, odds_ratio, odds_ratio_up
risk_ratio: risk_ratio_lo, risk_ratio, risk_ratio_up
An 'unsupported grain' is a set of fields from which we cannot derive an odds ratio and it's confidence intervals. These include grains where any requisite fields are NA.
The following grains are explicitly unsupported:
prev_table_pos_neg: P, Q, R, S
TODO: Link to documentation on sawmill fields.
A tibble of timber with sawmill status fields and additional field grain. Where checks fail, grain is NA.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.