As a clinical trial statistician or programmer, challenge anything in this benchmark: describe a problem in Comments, or propose a fix with the Edit button on any source file.
- Task: Would a real study need this derivation, specified this way? Does it follow CDISC standards: variable names, controlled terms, record structure? Flag any rule that is ambiguous or that a sponsor would handle differently.
- Inputs: Do they look like data collected in a real trial, and do they include the situations you would expect to meet in one?
- Expected output: Would independent QC programming reproduce every value from these inputs and rules?
The other tabs beside Comments are background for assessment, not under review.
Summary
README.mdGoal: derive an adjusted ratio (RATIO) and its variants by calling
the project's own ratio routine, showing how the call fills in
defaults, handles missing values, and switches the result to a
percentage.
Input: spec.yaml reads a small test file (input/source.csv)
carrying a numerator (NUM), a denominator (DEN), and an optional
adjustment (ADJ), and calls the ratio routine from the benchmark's
own Python project root (python/); the expected result is
expected/test.csv.
Variables:
ID: the test record identifier, carried through unchanged.RATIO: the numerator divided by the denominator, rounded to two places; empty when the numerator or the denominator is blank.RATIO_DEFAULT: the same value asRATIO: leaving the rounding places out of the call uses the project's own default of two.RATIO_PCT: the same ratio as a percentage, rounded to one place.RATIO_ADJ_MISSING:RATIOplus the adjustment; a blank adjustment counts as zero.RATIO_MISSING: empty on every record: the call passes no numerator at all, so the routine is never invoked.
Note: a blank value the routine does not accept skips the call entirely, so that record has no result; a blank value it accepts arrives as missing and counts as zero.
Inputs
Under review1 source fileinput/source.csv
Edit7 rows| ID | NUM | DEN | ADJ |
|---|---|---|---|
| R1 | 10.0 | 4.0 | — |
| R2 | 1.0 | 3.0 | 0.5 |
| R3 | 7.0 | 2.0 | 0.25 |
| R4 | 0.0 | 5.0 | — |
| R5 | 9.0 | 4.0 | -0.5 |
| R6 | — | 4.0 | — |
| R7 | 10.0 | — | — |
Expected output
Under review7 expected rowsexpected/test.csv
Edit7 rows| ID | RATIO | RATIO_DEFAULT | RATIO_PCT | RATIO_ADJ_MISSING | RATIO_MISSING |
|---|---|---|---|---|---|
| R1 | 2.5 | 2.5 | 250 | 2.5 | — |
| R2 | 0.33 | 0.33 | 33.3 | 0.8300000000000001 | — |
| R3 | 3.5 | 3.5 | 350 | 3.75 | — |
| R4 | 0 | 0 | 0 | 0 | — |
| R5 | 2.25 | 2.25 | 225 | 1.75 | — |
| R6 | — | — | — | — | — |
| R7 | — | — | — | — | — |
Comments and assessment materials
| Variable Name | Variable Label | Type | Length | Controlled Terms or Format | Origin | Core | Conversion Definition | Variable Type | Variable Order | Comments for Define |
|---|---|---|---|---|---|---|---|---|---|---|
| ID | Identifier | Char | Collected | Copy value from SOURCE.ID. | SDTM | 1 | ||||
| RATIO | Adjusted Ratio | Num | Derived | Call project function project_ratio with numerator = SOURCE.NUM, denominator = SOURCE.DEN, decimals = 2, adjust = 0.0 and as_percent = False. | SDTM | 2 | ||||
| RATIO_DEFAULT | Adjusted Ratio With Default Decimals | Num | Derived | Call project function project_ratio with numerator = SOURCE.NUM, denominator = SOURCE.DEN, adjust = 0.0 and as_percent = False. | SDTM | 3 | ||||
| RATIO_PCT | Adjusted Ratio As Percentage | Num | Derived | Call project function project_ratio with numerator = SOURCE.NUM, denominator = SOURCE.DEN, decimals = 1, adjust = 0.0 and as_percent = True. | SDTM | 4 | ||||
| RATIO_ADJ_MISSING | Adjusted Ratio With Missing Adjustment | Num | Derived | Call project function project_ratio with numerator = SOURCE.NUM, denominator = SOURCE.DEN, decimals = 2, adjust = SOURCE.ADJ and as_percent = False. | SDTM | 5 | ||||
| RATIO_MISSING | Ratio With Missing Numerator | Num | Derived | Call project function project_ratio with numerator = None, denominator = SOURCE.DEN, decimals = 2, adjust = 0.0 and as_percent = False. | SDTM | 6 |
| Version | Date | Author | Description | Reviewer | Sign-off |
|---|---|---|---|---|---|
| 1.3 | 2026-09-29 | yamaa docs build | Show study codelist names, external dictionaries, and ISO 8601 formats in variable rows; list the document's codelist values and metadata | ||
| 1.2 | 2026-09-29 | yamaa docs build | Classify ADaM copies from a declared input as Predecessor and recodes as Derived, and SDTM recodes of locally derived columns as Derived | ||
| 1.1 | 2026-09-29 | yamaa docs build | Resolve lookups into the donor record they select, and give every derivation shape a plain-language rule instead of its raw YAML | ||
| 1.0 | yamaa docs build | Initial generation from spec.yaml |
yamaa
Comments
Signed in with GitHub; saved in repository Discussions