log_odds: Calculate the log odds ratio with wald confidence intervals

Description Usage Arguments Examples

View source: R/log_odds.R

Description

log_odds computes the log odds ratio between two binary outcomes.

Usage

1
log_odds(n00, n01, n10, n11, alpha = 0.05, print.result = "df")

Arguments

n00

(numeric) A scalar for the number of observations exposed with the condition.

n01

(numeric) A scalar for the number of observations exposed without the condition.

n10

(numeric) A scalar for the number of observations not exposed with the condition.

n11

(numeric) A scalar for the number of observations not exposed without the condition.

alpha

(numeric) A value defining the probability for the wald confidence interval. Default is an alpha of 0.05, corresponding to a 0.95 % confidence interval.

print.result

(character) Either "vector" for output given in a vector or "df" for output given within a tibble (default).

Examples

1
2
3
4
5
6
7
# If we have a hypothetical group of smokers (exposed) and non-smokers (not exposed),
# then we can look for the rate of lung cancer (condition).
# 20 smokers have lung cancer (n00),
# 80 smokers do not have lung cancer (n01),
# one non-smoker has lung cancer (n10),
# and 99 non-smokers do not have lung cancer (n11).
log_odds(20, 80, 1, 99)

Ischi94/palint documentation built on Feb. 7, 2021, 4:37 a.m.