| odds_ratio | R Documentation |
This function displays odds ratios and their normal confidence intervals. This statistic is calculated as (level 1.1/level 1.2) / (level 2.1/level 2.2), which can be considered the odds of level 1.1 given level1 overall versus level2.1 given level2 overall.
odds_ratio(n11, n12, n21, n22, a = 0.05)
odds(n11, n12, n21, n22, a = 0.05)
n11 |
sample size for level 1.1 |
n12 |
sample size for level 1.2 |
n21 |
sample size for level 2.1 |
n22 |
sample size for level 2.2 |
a |
significance level |
**Note on function and output names:** This effect size is now implemented with the snake_case function name 'odds_ratio()' to follow modern R style guidelines. The original name 'odds()' is still available as a wrapper for backward compatibility, and both functions return the same list. The returned object includes both the original element names (e.g., 'odds', 'olow', 'ohigh', 'se') and newer snake_case aliases (e.g., 'odds_value', 'odds_lower_limit', 'odds_upper_limit', 'standard_error'). New code should prefer 'odds_ratio()' and the snake_case output names, but existing code using the older names will continue to work.
odds ratio statistic (legacy name; see also 'odds_value')
lower-level confidence interval of odds ratio (legacy name; see also 'odds_lower_limit')
upper-level confidence interval of odds ratio (legacy name; see also 'odds_upper_limit')
standard error (legacy name; see also 'standard_error')
odds ratio statistic (snake_case alias of 'odds')
lower-level confidence interval of odds ratio (alias of 'olow')
upper-level confidence interval of odds ratio (alias of 'ohigh')
standard error (alias of 'se')
# A health psychologist was interested in the rates of anxiety in
# first generation and regular college students. They polled campus
# and found the following data:
# | | First Generation | Regular |
# |--------------|------------------|---------|
# | Low Anxiety | 10 | 50 |
# | High Anxiety | 20 | 15 |
# What are the odds for the first generation students to have anxiety?
odds_ratio(n11 = 10, n12 = 50, n21 = 20, n22 = 15, a = .05)
# Backwards-compatible wrapper (deprecated name)
odds(n11 = 10, n12 = 50, n21 = 20, n22 = 15, a = .05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.