{
  "x402Version": 2,
  "id": 72531,
  "slug": "saylorinnovations-api-stats-bayes",
  "resource": "https://saylorinnovations.com/api/stats/bayes",
  "description": "Bayes calculator for a diagnostic test - positive and negative predictive value, likelihood ratios and a confusion matrix from prevalence, sensitivity and specificity",
  "type": "http",
  "serviceName": "Saylor Innovations Data Desk",
  "mimeType": "application/json",
  "resourceType": "API",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "eip155:137",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "eip155:42161",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "So11111111111111111111111111111111111111112",
      "amount": "95830",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    }
  ],
  "outputSchema": {
    "type": "object",
    "properties": {
      "inputs": {
        "type": "object",
        "description": "Inputs after validation, as percentages and the population size",
        "properties": {
          "population": {
            "description": "Population size used for the confusion matrix",
            "type": [
              "number",
              "null"
            ]
          },
          "prevalence_percent": {
            "type": [
              "number",
              "null"
            ],
            "description": "Prevalence, as a percentage"
          },
          "sensitivity_percent": {
            "type": [
              "number",
              "null"
            ],
            "description": "Sensitivity, as a percentage"
          },
          "specificity_percent": {
            "type": [
              "number",
              "null"
            ],
            "description": "Specificity, as a percentage"
          }
        }
      },
      "probability_of_positive_test_percent": {
        "type": "number",
        "description": "Probability of positive test, as a percentage"
      },
      "positive_predictive_value_percent": {
        "type": [
          "number",
          "null"
        ],
        "description": "Positive predictive value, as a percentage"
      },
      "false_discovery_percent": {
        "type": [
          "number",
          "null"
        ],
        "description": "False discovery, as a percentage"
      },
      "negative_predictive_value_percent": {
        "type": [
          "number",
          "null"
        ],
        "description": "Negative predictive value, as a percentage"
      },
      "positive_likelihood_ratio": {
        "type": [
          "number",
          "null"
        ],
        "description": "Positive likelihood ratio"
      },
      "negative_likelihood_ratio": {
        "type": [
          "number",
          "null"
        ],
        "description": "Negative likelihood ratio"
      },
      "confusion_matrix": {
        "type": "object",
        "description": "Confusion matrix"
      },
      "plain_language": {
        "type": [
          "string",
          "null"
        ],
        "description": "Plain language"
      },
      "note": {
        "type": "string",
        "description": "Caveat or context for reading the result"
      },
      "source": {
        "type": "string",
        "description": "Data source the values come from"
      },
      "probability_disease_given_negative_percent": {
        "type": [
          "number",
          "null"
        ],
        "description": "Probability disease given negative, as a percentage"
      }
    },
    "required": [
      "inputs",
      "positive_predictive_value_percent"
    ]
  },
  "extensions": {
    "bazaar": {
      "info": {
        "input": {
          "type": "http",
          "method": "GET",
          "queryParams": {
            "prevalence_percent": "1",
            "sensitivity_percent": "95",
            "specificity_percent": "90"
          }
        },
        "output": {
          "type": "json",
          "example": {
            "inputs": {
              "prevalence_percent": 1,
              "sensitivity_percent": 95,
              "specificity_percent": 90,
              "population": 100000
            },
            "probability_of_positive_test_percent": 10.85,
            "positive_predictive_value_percent": 8.756,
            "false_discovery_percent": 91.244,
            "negative_predictive_value_percent": 99.944,
            "probability_disease_given_negative_percent": 0.0561,
            "positive_likelihood_ratio": 9.5,
            "negative_likelihood_ratio": 0.055556,
            "confusion_matrix": {
              "true_positives": 950,
              "false_positives": 9900,
              "false_negatives": 50,
              "true_negatives": 89100
            },
            "plain_language": "Of every 100 people who test positive, about 9 actually have the condition when prevalence is 1%.",
            "note": "Bayes theorem with a single test and independent errors; real tests vary by population and are not medical advice.",
            "source": "Bayes theorem applied to prevalence, sensitivity and specificity"
          }
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "input": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "http"
              },
              "method": {
                "type": "string",
                "enum": [
                  "GET"
                ]
              },
              "queryParams": {
                "type": "object",
                "properties": {
                  "prevalence_percent": {
                    "type": "string",
                    "description": "How common the condition is, percent"
                  },
                  "sensitivity_percent": {
                    "type": "string",
                    "description": "True positive rate, percent"
                  },
                  "specificity_percent": {
                    "type": "string",
                    "description": "True negative rate, percent"
                  }
                },
                "required": [
                  "prevalence_percent",
                  "sensitivity_percent",
                  "specificity_percent"
                ]
              }
            },
            "required": [
              "type",
              "method"
            ],
            "additionalProperties": false
          },
          "output": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "json"
              },
              "example": {
                "type": "object",
                "properties": {
                  "inputs": {
                    "type": "object",
                    "description": "Inputs after validation, as percentages and the population size",
                    "properties": {
                      "population": {
                        "description": "Population size used for the confusion matrix",
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "prevalence_percent": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "description": "Prevalence, as a percentage"
                      },
                      "sensitivity_percent": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "description": "Sensitivity, as a percentage"
                      },
                      "specificity_percent": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "description": "Specificity, as a percentage"
                      }
                    }
                  },
                  "probability_of_positive_test_percent": {
                    "type": "number",
                    "description": "Probability of positive test, as a percentage"
                  },
                  "positive_predictive_value_percent": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Positive predictive value, as a percentage"
                  },
                  "false_discovery_percent": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "False discovery, as a percentage"
                  },
                  "negative_predictive_value_percent": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Negative predictive value, as a percentage"
                  },
                  "positive_likelihood_ratio": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Positive likelihood ratio"
                  },
                  "negative_likelihood_ratio": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Negative likelihood ratio"
                  },
                  "confusion_matrix": {
                    "type": "object",
                    "description": "Confusion matrix"
                  },
                  "plain_language": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Plain language"
                  },
                  "note": {
                    "type": "string",
                    "description": "Caveat or context for reading the result"
                  },
                  "source": {
                    "type": "string",
                    "description": "Data source the values come from"
                  },
                  "probability_disease_given_negative_percent": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Probability disease given negative, as a percentage"
                  }
                },
                "required": [
                  "inputs",
                  "positive_predictive_value_percent"
                ]
              }
            },
            "required": [
              "type"
            ]
          }
        },
        "required": [
          "input"
        ]
      }
    }
  },
  "tags": [
    "what is the chance i have it",
    "positive predictive value",
    "bayes theorem medical test",
    "false positive rate base rate",
    "likelihood ratio"
  ],
  "sourceHost": "saylorinnovations.com",
  "lastUpdated": "2026-10-26T22:14:01.957Z",
  "quality": {},
  "metadata": {
    "serviceName": "Saylor Innovations Data Desk",
    "method": "GET",
    "mimeType": "application/json",
    "inputSchema": {
      "type": "object",
      "properties": {
        "prevalence_percent": {
          "type": "string",
          "description": "How common the condition is, percent"
        },
        "sensitivity_percent": {
          "type": "string",
          "description": "True positive rate, percent"
        },
        "specificity_percent": {
          "type": "string",
          "description": "True negative rate, percent"
        }
      },
      "required": [
        "prevalence_percent",
        "sensitivity_percent",
        "specificity_percent"
      ]
    },
    "exampleResponse": {
      "inputs": {
        "prevalence_percent": 1,
        "sensitivity_percent": 95,
        "specificity_percent": 90,
        "population": 100000
      },
      "probability_of_positive_test_percent": 10.85,
      "positive_predictive_value_percent": 8.756,
      "false_discovery_percent": 91.244,
      "negative_predictive_value_percent": 99.944,
      "probability_disease_given_negative_percent": 0.0561,
      "positive_likelihood_ratio": 9.5,
      "negative_likelihood_ratio": 0.055556,
      "confusion_matrix": {
        "true_positives": 950,
        "false_positives": 9900,
        "false_negatives": 50,
        "true_negatives": 89100
      },
      "plain_language": "Of every 100 people who test positive, about 9 actually have the condition when prevalence is 1%.",
      "note": "Bayes theorem with a single test and independent errors; real tests vary by population and are not medical advice.",
      "source": "Bayes theorem applied to prevalence, sensitivity and specificity"
    },
    "parameterLocation": "query",
    "extensions": {
      "bazaar": {
        "info": {
          "input": {
            "type": "http",
            "method": "GET",
            "queryParams": {
              "prevalence_percent": "1",
              "sensitivity_percent": "95",
              "specificity_percent": "90"
            }
          },
          "output": {
            "type": "json",
            "example": {
              "inputs": {
                "prevalence_percent": 1,
                "sensitivity_percent": 95,
                "specificity_percent": 90,
                "population": 100000
              },
              "probability_of_positive_test_percent": 10.85,
              "positive_predictive_value_percent": 8.756,
              "false_discovery_percent": 91.244,
              "negative_predictive_value_percent": 99.944,
              "probability_disease_given_negative_percent": 0.0561,
              "positive_likelihood_ratio": 9.5,
              "negative_likelihood_ratio": 0.055556,
              "confusion_matrix": {
                "true_positives": 950,
                "false_positives": 9900,
                "false_negatives": 50,
                "true_negatives": 89100
              },
              "plain_language": "Of every 100 people who test positive, about 9 actually have the condition when prevalence is 1%.",
              "note": "Bayes theorem with a single test and independent errors; real tests vary by population and are not medical advice.",
              "source": "Bayes theorem applied to prevalence, sensitivity and specificity"
            }
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "type": "object",
          "properties": {
            "input": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "http"
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET"
                  ]
                },
                "queryParams": {
                  "type": "object",
                  "properties": {
                    "prevalence_percent": {
                      "type": "string",
                      "description": "How common the condition is, percent"
                    },
                    "sensitivity_percent": {
                      "type": "string",
                      "description": "True positive rate, percent"
                    },
                    "specificity_percent": {
                      "type": "string",
                      "description": "True negative rate, percent"
                    }
                  },
                  "required": [
                    "prevalence_percent",
                    "sensitivity_percent",
                    "specificity_percent"
                  ]
                }
              },
              "required": [
                "type",
                "method"
              ],
              "additionalProperties": false
            },
            "output": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "json"
                },
                "example": {
                  "type": "object",
                  "properties": {
                    "inputs": {
                      "type": "object",
                      "description": "Inputs after validation, as percentages and the population size",
                      "properties": {
                        "population": {
                          "description": "Population size used for the confusion matrix",
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "prevalence_percent": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Prevalence, as a percentage"
                        },
                        "sensitivity_percent": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Sensitivity, as a percentage"
                        },
                        "specificity_percent": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Specificity, as a percentage"
                        }
                      }
                    },
                    "probability_of_positive_test_percent": {
                      "type": "number",
                      "description": "Probability of positive test, as a percentage"
                    },
                    "positive_predictive_value_percent": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Positive predictive value, as a percentage"
                    },
                    "false_discovery_percent": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "False discovery, as a percentage"
                    },
                    "negative_predictive_value_percent": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Negative predictive value, as a percentage"
                    },
                    "positive_likelihood_ratio": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Positive likelihood ratio"
                    },
                    "negative_likelihood_ratio": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Negative likelihood ratio"
                    },
                    "confusion_matrix": {
                      "type": "object",
                      "description": "Confusion matrix"
                    },
                    "plain_language": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Plain language"
                    },
                    "note": {
                      "type": "string",
                      "description": "Caveat or context for reading the result"
                    },
                    "source": {
                      "type": "string",
                      "description": "Data source the values come from"
                    },
                    "probability_disease_given_negative_percent": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Probability disease given negative, as a percentage"
                    }
                  },
                  "required": [
                    "inputs",
                    "positive_predictive_value_percent"
                  ]
                }
              },
              "required": [
                "type"
              ]
            }
          },
          "required": [
            "input"
          ]
        }
      }
    },
    "examples": [
      {
        "label": "Unpaid discovery call",
        "method": "GET",
        "url": "https://saylorinnovations.com/api/stats/bayes?prevalence_percent=1&sensitivity_percent=95&specificity_percent=90",
        "expectedStatus": 402
      }
    ],
    "cacheTtlSeconds": 0,
    "capabilities": [],
    "noAccountRequired": true,
    "noApiKeyRequired": true,
    "sideEffects": "Paid calls settle the advertised payment; see the provider contract for execution behavior.",
    "payment": {
      "protocol": "x402",
      "settlement": "direct-to-provider"
    },
    "provider": {
      "name": "Saylor Innovations",
      "host": "saylorinnovations.com",
      "manifestUrl": "https://saylorinnovations.com/.well-known/x402.json"
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": true,
  "featured": false,
  "provider": {
    "host": "saylorinnovations.com",
    "manifest_name": "Saylor Innovations Knowledge Base",
    "source": "submitted",
    "source_manifest_url": "https://saylorinnovations.com/.well-known/x402.json",
    "submitted_at": "2026-10-26T05:52:02.113Z"
  },
  "exampleResponse": {
    "inputs": {
      "population": 0,
      "prevalence_percent": 0,
      "sensitivity_percent": 0,
      "specificity_percent": 0
    },
    "probability_of_positive_test_percent": 0,
    "positive_predictive_value_percent": 0,
    "false_discovery_percent": 0,
    "negative_predictive_value_percent": 0,
    "positive_likelihood_ratio": 0,
    "negative_likelihood_ratio": 0,
    "confusion_matrix": {},
    "plain_language": "string",
    "note": "string",
    "source": "string",
    "probability_disease_given_negative_percent": 0
  }
}