Skip to main content
Glama

survey_cox

Fit survey-weighted Cox proportional hazards models to NHANES data, accounting for complex survey design to analyze mortality outcomes.

Instructions

Survey-weighted Cox proportional hazards model (Breslow ties, Binder linearized variance; same estimator as SUDAAN SURVIVAL / R svycoxph). Typical use with include_mortality=True: time='PERMTH_INT' (or PERMTH_EXM), event='MORTSTAT', domain including 'ELIGSTAT == 1'. Categorical predictors must be dummy-coded first with derive_variable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeYes
eventYes
domainNo
dataset_idYes
predictorsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden and delivers useful detail: Breslow ties, Binder linearized variance, equivalence to known R/SUDAAN functions, and the prerequisite that categorical predictors be dummy-coded first. It does not mention output format or missing-data handling, but the core behavioral constraints are disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences with no filler. The estimator identity is front-loaded, followed by a practical usage example and a critical prerequisite. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is good for constructing a typical call, but the tool is a complex model fitter with no output schema and no description of returned results or how to interpret them. It also does not explicitly distinguish when to use Cox vs. survey_regression, leaving some ambiguity for an autonomous agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description compensates by giving concrete values for time ('PERMTH_INT'/'PERMTH_EXM'), event ('MORTSTAT'), and domain ('ELIGSTAT == 1'), plus a dummy-coding requirement for predictors. dataset_id is left to inference and include_mortality is mentioned outside the schema, but the primary call shape is well illustrated.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific statistical procedure: survey-weighted Cox proportional hazards modeling, and anchors it to known estimator implementations (SUDAAN SURVIVAL, R svycoxph). This makes the purpose unmistakable and distinguishes it from siblings like survey_regression and survey_frequency.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides a concrete typical-use scenario for mortality/time-to-event analysis with exact values for time, event, and domain. It does not explicitly name alternatives or state when NOT to use this tool, so it stops short of full routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.