Description Usage Arguments Value Author(s) References Examples
View source: R/estimate_log_odds.R
Estimate the log odds ratio and stanard error for counts of treatment relative to reference
1 2 3 4 5 6 7 8 9 | estimate_log_odds(
count_data_frame,
group_name_char = "group",
reference,
number_on_first_day_char = "N_first_day",
count_desc_char = c("PR", "EOS_CR", "PR_or_EOS_CR")[1],
additive_offset = 0.5,
return_original = TRUE
)
|
count_data_frame |
data.frame with one row per group, total number per group, and number of positive counts out of the total |
group_name_char |
character name of column with group factor identifier. |
reference |
character name of level to use as a reference; must be in levels of factor designated by group_name_char. |
number_on_first_day_char |
character name of column with total number in a each group. |
count_desc_char |
character name of column with number of positive cases in each group. |
additive_offset |
numeric value to add to each count in a 2 x 2 table before computing log odds ratio. Default gives the Haldane-Anscombe-Gart correction of adding 0.5 to every count. |
return_original |
logical whether to return the original counts in the table with the estimated log_OR and SE_log_OR. |
A data.frame with log odds ratio (log_OR) and its standard error (SE_log_OR) for each non-reference group relative to reference.
Bill Forrest <forrest@gene.com>
Bill Forrest forrest@gene.com
1 2 3 4 5 | test_log_odds <- data.frame( group = factor( c( 'group_01', 'group_02', 'group_03' ) ),
N_first_day = rep( 10, 3 ),
PR = c( 0, 2, 6 )
)
log_odds_est <- maeve:::estimate_log_odds( test_log_odds, reference = 'group_01' )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.