Learn R Programming

biostats (version 1.1.1)

effect_measures: Effect Measures

Description

Calculates measures of effect: Odds Ratio (OR), Risk Ratio (RR), and either Number Needed to Treat (NNT) or Number Needed to Harm (NNH).

Usage

effect_measures(
  exposed_event,
  exposed_no_event,
  unexposed_event,
  unexposed_no_event,
  alpha = 0.05,
  correction = TRUE
)

# S3 method for effect_measures print(x, ...)

Value

An object of class "effect_measures" containing the contingency table, effect size estimates (OR, RR, risk difference, NNT/NNH), and related statistics.

Arguments

exposed_event

Numeric value indicating the number of events in the exposed group.

exposed_no_event

Numeric value indicating the number of non-events in the exposed group.

unexposed_event

Numeric value indicating the number of events in the unexposed group.

unexposed_no_event

Numeric value indicating the number of non-events in the unexposed group.

alpha

Numeric value between 0 and 1 specifying the alpha level for confidence intervals (CI). Default: 0.05.

correction

Logical parameter that indicates whether a continuity correction (0.5) will be applied when any cell contains 0. Default: TRUE.

x

An object of class "effect_measures".

...

Further arguments passed to or from other methods.

Methods (by generic)

  • print(effect_measures): Print method for objects of class "effect_measures".

Examples

Run this code
effect_measures(exposed_event = 15, 
                exposed_no_event = 85,
                unexposed_event = 5,
                unexposed_no_event = 95)

Run the code above in your browser using DataLab