Hub
Pricing About
NodeNode / Manipulator

Odds and Risk Ratios

KNIME LabsStatistics
Drag & drop
Like

This node calculates the Maximum Likelihood Estimate (MLE) Odds Ratio (OR) and the Maximum Likelihood Estimate (MLE) Risk Ratio (RR), i.e., "Wald" OR and RR, from two selected categorical columns. For each column a value is selected to be considered the value under observation. All other values in non-binary categorical columns are considered as the "not" case.

X¬ XYab¬ Ycd

Odds Ratio:
OR = (a/b) / (c/d) = (a * d) / (b * c)

Risk Ratio:
RR = (a / (a+b)) / (c / (c+d))

Fisher's Exact Test is calculated with
p = (a + b)!(c + d)!(a + c)!(b + d)! / (a!b!c!d!n!), where
n = a + b + c + d
over the sum of the marginal tables.

The two-tailed, left-tailed, and right-tailed p-values are calculated. The value for the Laplace correction is not considered for this calculation.

The Chi-Squared Test ( Χ 2 ) is calculated with
Χ 2 = ∑ i ∑ j (O ij - E ij ) 2 / E ij 2
where
E ij = T i * T j /n
and
T i and T j are the sums of the row and columns respectively.

Yates' Corrected Χ 2 is
Χ 2 Yates = ∑ i ∑ j (|O ij - E ij |-0.5) 2 / E ij 2

Pearson's Coefficient of Contingency
Pearson's C = √Χ 2 / (Χ 2 + n)

Cramér's Coefficient of Contingency
Cramér's V = √Χ 2 /n

Node details

Input ports
  1. Type: Table
    Data
    The data table with the two features to compare.
Output ports
  1. Type: Table
    Results
    The output table with the results and significance measurements.
  2. Type: Table
    Contingency Table
    A table with the values from the table shown above.

Extension

The Odds and Risk Ratios node is part of this extension:

  1. Go to item

Related workflows & nodes

  1. Go to item
  2. Go to item
  3. Go to item

KNIME
Open for Innovation

KNIME AG
Talacker 50
8001 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • Courses + Certification
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more about KNIME Business Hub
© 2025 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Data Processing Agreement
  • Credits