# Relative Risk & Odds Ratio Calculator AI Agent Connect

> Relative Risk & Odds Ratio Calculator MCP lets your AI client perform statistical analysis on 2x2 contingency tables. It calculates Relative Risk, Odds Ratio, Risk Difference, and Attributable Fraction while providing confidence intervals. The tool handles zero-cell issues using Haldane-Anscombe correction to keep your math stable.

## Overview
- **Category:** science
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_2PhrgV72izQT9AJBRKV8QaQXa1AYzHu5li2kY4VC/ai-agent-connect
- **Tags:** epidemiology, statistics, math, science, data

## Description

You can now hand off complex epidemiological math to your AI agent. This MCP handles the heavy lifting of processing 2x2 contingency tables to produce the specific effect measures you need for research or clinical analysis. Instead of manually calculating ratios, you provide the raw data and let your agent run the numbers. It calculates Relative Risk, Odds Ratio, Risk Difference, and Attributable Fraction, complete with confidence intervals. To prevent math errors when a cell contains a zero, the MCP uses Haldane-Anscombe correction for stability. You can also use it to verify that your data is logically consistent or to determine if your study design requires a cohort or case-control approach. It turns your AI client into a specialized statistical tool for public health and clinical research.

## Tools

### calculate_epidemiologic_measures
This tool computes Relative Risk, Odds Ratio, Risk Difference, and Attributable Fraction from a 2x2 table. It also provides the necessary confidence intervals for these measures.

### compare_study_types
This tool identifies whether a study uses a cohort or case-control design. It helps your agent pick the right effect measure for the specific study type.

### get_risk_summary
This tool pulls specific risk probabilities for both exposed and unexposed groups. It gives you a clear breakdown of the risk levels within each group.

### validate_table_integrity
This tool checks your 2x2 contingency table for logical consistency. It ensures the data makes sense before you run any statistical calculations.

## Prompt Examples

**Prompt:** 
```
Calculate the epidemiologic measures for a cohort study with 50 exposed cases, 150 exposed non-cases, 20 unexposed cases, and 180 unexposed non-cases.
```

**Response:** 
```
The Relative Risk is 1.25, the Odds Ratio is 1.28, and the Risk Difference is 0.05. The 95% confidence interval for the Relative Risk is [0.85, 1.82].
```

**Prompt:** 
```
What is the risk summary for 10 exposed cases out of 100 exposed people, and 5 unexposed cases out of 100 unexposed people?
```

**Response:** 
```
The risk in the exposed group is 0.10 (10%) and the risk in the unexposed group is 0.05 (5%). The total exposed population is 100 and the total unexposed population is 100.
```

**Prompt:** 
```
Which measure is better for a case-control study?
```

**Response:** 
```
For a case-control study, the Odds Ratio is the recommended measure because it focuses on the odds of exposure among cases compared to non-cases.
```

## Capabilities

### Effect Measure Calculation
Your agent uses this to derive Relative Risk and Odds Ratio from raw table data.

### Zero-Cell Correction
The MCP applies Haldane-Anscombe correction to maintain mathematical stability when cells are empty.

### Study Design Analysis
Your agent uses this to decide between cohort and case-control statistical approaches.

### Data Validation
The agent runs this to check the logical integrity of your contingency tables.

### Risk Summarization
Your agent uses this to extract specific probabilities for exposed and unexposed populations.

## Use Cases

### Cohort Study Analysis
Calculate Relative Risk and Risk Difference directly from cohort data tables.

### Case-Control Studies
Use the agent to automatically apply Odds Ratio calculations for case-control designs.

### Data Integrity Checks
Verify that your contingency tables are logically sound before starting a full analysis.

### Risk Comparison
Compare the probability of outcomes between exposed and unexposed groups quickly.

## Benefits

- Handles zero-cell values using Haldane-Anscombe correction for stable results.
- Provides confidence intervals alongside all primary effect measures.
- Automates the selection of measures based on study design.
- Validates table logic to prevent errors in downstream analysis.

## How It Works

Connect your AI client to Vinkius and start running stats immediately.

1. Connect your preferred MCP-compatible client to Vinkius.
2. Provide your 2x2 contingency table data to your AI agent.
3. Ask the agent to calculate specific measures or validate the table.
4. Receive formatted statistical results including confidence intervals.

## Frequently Asked Questions

**How does this MCP handle zero values in a table?**
It uses the Haldane-Anscombe correction. This ensures the math remains stable even when a cell in your 2x2 table is zero.

**Can I use this with Claude or Cursor?**
Yes. This MCP works with any MCP-compatible client, including Claude, Cursor, and Windsurf.

**What specific measures can be calculated?**
The MCP calculates Relative Risk, Odds Ratio, Risk Difference, and Attributable Fraction.

**Does it provide confidence intervals?**
Yes, the tool provides confidence intervals for the calculated epidemiologic measures.

**How do I know if I should use Odds Ratio or Relative Risk?**
You can use the compare_study_types tool. It helps your agent determine the correct measure based on whether you are running a cohort or case-control study.

**How do I handle zero values in my contingency table?**
You can use the `useHaldaneAnscombeCorrection` parameter in the `calculate_epidemiologic_measures` tool. When enabled, it adds a constant of 0.5 to each cell to prevent division by zero.

**When should I use Relative Risk versus Odds Ratio?**
Use Relative Risk for cohort studies where the total population is known. Use Odds Ratio for case-control studies. You can use `compare_study_types` to get a recommendation based on your study design.

**Can I validate my data before running full calculations?**
Yes, use the `validate_table_integrity` tool to check if your counts are non-negative and logically consistent before proceeding with effect measure calculations.
