estimate_log_odds: Estimate the log odds ratio and stanard error for counts of...

Description Usage Arguments Value Author(s) References Examples

View source: R/estimate_log_odds.R

Description

Estimate the log odds ratio and stanard error for counts of treatment relative to reference

Usage

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
)

Arguments

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.

Value

A data.frame with log odds ratio (log_OR) and its standard error (SE_log_OR) for each non-reference group relative to reference.

Author(s)

Bill Forrest <forrest@gene.com>

Bill Forrest forrest@gene.com

References

www.r-project.org

Examples

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' )

wfforrest/maeve documentation built on Jan. 1, 2021, 12:47 p.m.