# Diagnostic Test Positivity Rate Calculator AI Agent Connect

> Diagnostic Test Positivity Rate Calculator MCP handles complex epidemiological math for you. It calculates positivity rates using specific denominator conventions like all tests or valid tests, manages patient-level deduplication to prevent overcounting, and provides statistical confidence intervals. You can connect it to Claude, Cursor, or Windsurf to turn raw test counts into actionable health trends.

## Overview
- **Category:** healthcare
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_ru2jgEjw55g2cxSbiihvkZLelvqAEmvOldZJatEl/ai-agent-connect
- **Tags:** positivity-rate, diagnostic, data-analysis, epidemiology, statistics

## Description

You can use this MCP to run precise epidemiological analyses without manually calculating denominators or confidence intervals. It handles the heavy lifting of diagnostic math, including the ability to choose between different denominator conventions like 'all_tests' or 'valid_tests' to ensure your rates match your specific reporting standards. If you are worried about overcounting, the MCP includes patient-level deduplication within a set window to keep your data clean. You can also break down results by specimen type or aggregate data into specific time frames to spot emerging trends. It is built to turn raw test counts and specimen data into statistically sound insights for public health or clinical monitoring.

## Tools

### analyze_specimen_distribution
This tool compares positivity rates across different specimen types. Use it to see if certain sample types show higher infection rates.

### filter_by_period
This tool aggregates test data into specific time frames. It is useful for identifying trends over days, weeks, or months.

### get_confidence_interval
This tool calculates the statistical confidence interval for a given positivity rate. Use it to determine the precision of your findings.

### calculate_positivity_metrics
This tool performs the core positivity rate calculations. It uses your provided test counts and specific configuration settings to generate metrics.

## Prompt Examples

**Prompt:** 
```
Calculate the positivity rate for 50 positive, 150 negative, and 10 indeterminate tests using the all_tests convention.
```

**Response:** 
```
The positivity rate is 25% based on 210 total tests.
```

**Prompt:** 
```
What is the 95% confidence interval for a positivity rate of 0.2 with 500 total tests?
```

**Response:** 
```
The 95% confidence interval is [0.168, 0.236].
```

**Prompt:** 
```
Compare the positivity rates for different specimen types in this data: [{'result': 'positive', 'specimenType': 'Nasopharyngeal'}, {'result': 'negative', 'specimenType': 'Oral'}]
```

**Response:** 
```
The Nasopharyngeal positivity rate is 100% (1 test) and the Oral positivity rate is 0% (1 test).
```

## Capabilities

### Denominator Configuration
Your agent can switch between all tests or valid tests for rate calculations.

### Patient Deduplication
The MCP prevents overcounting by deduplicating patients within a specified window.

### Statistical Precision
Your AI client can generate confidence intervals to validate the accuracy of rates.

### Specimen Comparison
The tool compares how different specimen types affect positivity outcomes.

### Temporal Aggregation
Your agent can group data by time periods to track infection trends.

## Use Cases

### Outbreak Monitoring
Use the tool to aggregate test data by period to see if positivity rates are rising in a specific area.

### Specimen Efficacy Studies
Compare positivity rates between Nasopharyngeal and Oral samples to evaluate testing methods.

### Data Cleaning
Apply deduplication to large datasets to ensure one patient doesn't inflate the positivity rate.

### Reporting Accuracy
Calculate confidence intervals to provide a range of certainty for published health reports.

## Benefits

- Reduces manual math errors by automating denominator selection.
- Prevents statistical skewing through patient-level deduplication.
- Provides statistical confidence intervals for every rate calculated.
- Speeds up trend analysis by aggregating data into time windows.

## How It Works

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

1. Connect your preferred MCP-compatible client like Claude or Cursor to Vinkius.
2. Provide your raw test data or counts to your AI agent.
3. Specify your preferred denominator convention or time window in your prompt.
4. The MCP executes the math and returns the rates, intervals, or distributions.

## Frequently Asked Questions

**How does this MCP handle different denominator types?**
The MCP allows you to choose between different conventions, such as using all tests or only valid tests, for your positivity rate calculations.

**Can I prevent overcounting in my data?**
Yes, the MCP includes a feature for patient-level deduplication within a specified window to ensure your rates are not inflated by repeat testers.

**What AI clients can I use with this MCP?**
You can use this MCP with any compatible client, including Claude, Cursor, Windsurf, and VS Code.

**Does it provide statistical confidence intervals?**
Yes, you can use the get_confidence_interval tool to calculate the precision of any positivity rate you generate.

**Can I analyze trends over time?**
Yes, the filter_by_period tool allows your agent to aggregate data into specific time frames to identify trends.

**What is the difference between the denominator conventions?**
The 'all_tests' convention includes every test result in the denominator, while 'valid_tests' only includes conclusive positive and negative results.

**How does patient-level deduplication work?**
By using `calculate_positivity_metrics` with a `deduplicationWindowDays` parameter, the tool identifies repeat tests from the same patient within that timeframe and excludes them to prevent bias.
