FlowScript is the language you write in the Lab. A FlowScript document is a list of typed blocks (a study, a cohort, an estimate, a survival curve, a task) whose attributes hold numbers with units and intervals, text, references to other blocks and derived values. One or more view lines then say which figures to draw from it. Because every block has a known kind, the Lab can check the document as you type: that each count is a whole number that can exist, that a flow balances at every step, that a stated rate or p-value matches the counts beside it, that a unit is real and of the right kind, that an interval contains its own estimate, that every reference points at something, and that your own stated rules hold. This page is the complete reference: the syntax, every kind of value, units, uncertainty, the expression language, the check block, view lines, all 125 block kinds with every attribute, and every error and warning the Lab can show you, with what to do about each.
At a glance
| Topic | Summary |
|---|---|
| A block | kind id { attribute: value attribute: value }. Blocks can nest |
| A view | view name: renderer(argument) on a line of its own, for example view flow: consort(trial) |
| Comments | // to the end of the line and /* across lines */ |
| Text | Double quotes, on one line: "Drug X 50 mg daily" |
| Numbers | 42, -3.5, .5, 1e9, 12% |
| Units | Straight after a number: 5 mg/kg/day, 14 months, 3.2 per 100000, 120 participants |
| Uncertainty | 0.68 [0.51, 0.90], 0.68 (0.51 to 0.90), 12.4 ± 0.8, 0.42 se 0.11, optionally followed by @ 90% |
| References | A block id (from: screened) or a dotted path to one of its numbers (randomised.n) |
| Derived values | An attribute value that starts with =, such as n: = randomised.n - 40 |
| Sources | n: 1502 source "Screening log" or source { dataset: "trial.csv", column: "age", rows: 240 } |
| Your own rules | check name { that: = …, else: "…", severity: warn } |
| Vocabulary | 125 block kinds in 22 fields, plus any kind you invent |
| Severity | Errors are things that are wrong and must be fixed. Warnings are probably wrong. Notes are worth knowing. The Lab still draws whatever it can read; only text it cannot read at all (an unclosed quote or comment, a stray character) leaves the canvas empty |
A first document
// A two-arm trial. Edit any n and the Lab checks the flow again.
study trial {
design: "Randomised, parallel-group"
registry: "NCT00000000"
}
cohort screened { n: 1502 source "Screening log, May 2024" }
cohort randomised {
n: 1200
from: screened
excluded: { ineligible: 238, declined: 64 }
}
arm placebo { n: 600, from: randomised, intervention: "Placebo" }
arm drug_x { n: 600, from: randomised, intervention: "Drug X 50 mg daily" }
outcome death_30d {
metric: "30-day all-cause mortality"
control: { events: 72, n: 600, rate: = events / n * 100 }
treatment: { events: 48, n: 600, rate: 8.0% }
test: "chi-squared"
p: 0.021
}
check arms_balance {
that: = sum(kind:arm, "n") == randomised.n
else: "The arms hold {sum(kind:arm, \"n\")} people, not {randomised.n}."
}
view flow: consort(trial)
This document compiles with no issues. Change excluded: { ineligible: 238, declined: 64 } to { ineligible: 238 } and the Lab reports:
Arithmetic inconsistency: screened.n (1502) − sum(excluded) (238) = 1264, but randomised.n is 1200.
Change p: 0.021 to p: 0.9 and it warns that the p-value is not what a chi-squared test gives for 72/600 against 48/600 ("that is 0.021 or 0.027", with and without the continuity correction).
How a document is built
Blocks
A block is a kind, an optional id, and a body in braces:
cohort screened { n: 1502 }
cohort eligible {
n: 1240
from: screened
excluded: { ineligible: 198, declined: 64 }
}
| Part | Rules |
|---|---|
| Kind | The first word: cohort. Any identifier. The 125 registered kinds are checked against their schema; any other word is accepted as your own kind and carried as plain data |
| Id | The second word: eligible. Optional in the grammar. Most registered kinds expect one, and a block without one is warned about: "Block "cohort" should have an identifier (e.g. cohort my_id { … })." Ids must be unique in the document |
| Body | { … } holding attributes and nested blocks, in any order |
Identifiers
An identifier starts with a letter or _, then letters, digits, _ and -. Kinds, ids, attribute names and bare words are all identifiers.
Tip: Use only letters, digits and_in block ids. A hyphen is legal in an id, but an expression readsarm-a.nas "arm minus a.n", and renaming withF2refuses ids with hyphens.
Attributes
An attribute is a name, a colon and a value: n: 1240. Attributes are separated by new lines; commas between them are optional, so { n: 600, from: randomised } and the same on two lines are identical. Each kind declares the attributes it understands. An attribute it does not know is kept as data and warned about: "Attribute "x" is not part of the study schema — it will be carried through as freeform data." A required attribute that is missing is an error: "outcome is missing required attribute metric."
Nesting
Blocks may contain blocks:
survival os {
time_unit: "months"
group drug { label: "Drug X", times: [3, 8, 12, 20], events: [1, 0, 1, 0] }
group usual { label: "Usual care", times: [2, 5, 9, 14], events: [1, 1, 0, 1] }
}
Nesting never makes a document invalid. Some kinds list their typical children (a study holds cohort, arm, outcome, view and note); putting something else inside one gives a warning such as "task is not a typical child of study (allowed: cohort, arm, outcome, view, note)." For several figures, nesting carries meaning (a group inside a survival is a curve; inside a table_one it is a column), so check Lab views and renderers for the shape each figure expects.
Comments
// A line comment runs to the end of the line.
/* A block comment
can span lines. */
cohort a { n: 10 } // a comment may follow code
An unclosed /* is an error ("Unterminated /* … */ block comment") that stops the whole document being read.
Your own kinds
The vocabulary is open. factor laser_power { level: 3 } is a valid block even though factor is not a registered kind: it is not checked against any schema, its numbers can still be referenced and used in expressions, and nothing warns about its attributes. Registered kinds are the ones the Lab's figures, checks and reporting standards understand.
The only alias is captable, which is read as cap_table.
Values
| Value | Examples | Notes |
|---|---|---|
| Text | "Placebo", "Day 0 is the first dose" | Double quotes only. Escapes: \", \\, \n, \t. A string must end on the line it starts on; a missing closing quote is "Unterminated string literal" and stops the whole document being read |
| Number | 42, 12.5, -3.14, +7, .5, 1e9, 2.5e-3 | 1e9 is a thousand million. An exponent too large to represent (1e999) is refused as a number, and you get an unrecognised-unit warning instead |
| Number with unit | 5 mg/kg/day, 120 participants, 25% | See Units |
| Estimate | 0.68 [0.51, 0.90], 12.4 ± 0.8 | See Uncertainty |
| Derived value | = randomised.n - 40 | See Expressions |
true, false, null | blinded: true | Booleans and the empty value |
| Word | measure: hr, judgement: some_concerns | A bare identifier. In an attribute the schema declares as a reference it must name a block; otherwise it is a word from a list or free data |
| Dotted reference | results.hr, randomised.n | Always checked: the block must exist and must have the named attribute |
| List | [3, 8, 12], ["Age", "Sex"], [task_a, task_b] | Comma-separated, in square brackets |
| Object | { events: 72, n: 600 } | Named entries in braces. Numbers one level inside an object can be referenced (death_30d.control.events) |
What each attribute type accepts
The block reference gives each attribute a type:
| Type | Write | Checked |
|---|---|---|
| Text | "…" | No |
| Number | 12, 0.95 | Range and whole-number rules where listed |
| Percent | 92% or 0.92 | Both spellings are accepted and never converted into each other. A unit that is not a percentage or ratio (3.2 kg) is an error |
| Quantity | A number with a unit: 14 months, 88 mm | Where a dimension is listed, the unit must be of that kind (a duration, a proportion). A bare number is accepted |
| Estimate | 0.68 [0.51, 0.90] or a plain number | See Uncertainty |
| Expression | = … | Must produce a number |
| Block id | from: screened | Must name a block in the document |
| List of block ids | depends: [design, build] | Each must name a block |
| List of numbers, List of labels | [1, 2, 3], ["a", "b"] | Not treated as references |
| Word | measure: hr | Where a list of allowed words is given, the word must be one of them |
true/false | blinded: true | No |
| Object | { … } | Its entries are not checked against a schema |
Allowed words are matched without regard to case or punctuation, so very_low, very-low and Very Low all match very_low, and judgement: low and judgement: "low" are the same.
References
A reference points from one block to another.
| Form | Example | What is checked |
|---|---|---|
| A block id in an attribute the schema declares as a reference | from: screened, model: gpt_small, depends: [design, build] | The block must exist: "Reference screened does not resolve — no block declared with id "screened"." |
| A dotted path anywhere | about: randomised.n | The block must exist, and so must the path inside it: "Reference c.bogus does not resolve — block "c" has nothing named bogus." |
| A path inside an expression | = randomised.n - 40 | See Expressions |
| A view argument | view flow: consort(trial) | A warning when no block has that id (see View lines) |
A bare word in an attribute that is not declared as a reference (mode: web, arm: treatment) is never treated as a reference, so it is never reported as missing.
Duplicate ids are an error: "Duplicate id "s" — every block id must be unique." The first block keeps the id; references resolve to it.
Working with references in the editor
F12on an id jumps to its declaration;⇧F12lists every use.F2renames an id in every place it is used: its declaration, references, derived values, selectors and view arguments, but not inside strings or comments. The rename refuses an id that is already taken, one that is not a valid id, or one that is not declared, with the reason.- Hovering an id shows the block and up to six of its numbers.
Sources
Any attribute value may be followed by where it came from. The source is recorded with the number; it shows in the editor's hover, the Provenance pane and the submission bundle.
cohort screened { n: 1502 source "Screening log, exported 2024-05-03" }
dataset trial_data { path: "trial.csv", format: csv, rows: 240 }
distribution age {
mean: 61.4 source { dataset: "trial.csv", column: "age", rows: 240, aggregation: "mean" }
}
| Form | Recorded as |
|---|---|
source "text" | A typed source, in your words |
source { dataset: …, column: … } | A dataset column. file or path may be written for dataset, field for column; rows is a number; aggregation (or agg) names how the number was computed |
source { … } with other entries | A typed source made from the entries, so nothing you wrote is lost |
A number with no source is recorded as typed by hand. The Provenance pane lists those so you can decide which need one.
Units
A unit is written straight after a number, on the same line: dose: 5 mg/kg/day. The Lab parses it, knows what kind of quantity it is, converts between compatible units when it compares numbers, and refuses to compare incompatible ones.
Writing a unit
| Form | Examples |
|---|---|
| A symbol or word | mg, mL, mmHg, °C, days, participants |
| Prefixed SI units | Any SI prefix from yocto to yotta on prefixable units: µg, ug, pmol, GBq, dL, kPa |
| Division and multiplication | mg/kg/day, mmol/L, kg/m^2, N*m, 5 mg / kg (spaces around an operator are allowed) |
| Powers | m^2, m2, cm3, s^-1, s-1 |
| Rates per a number | 3.2 per 100000, 3.2 per 100 000, 12 per 1000, 5 mg per kg |
| Counts | 120 participants, 14 events, 4 events/py |
Three words that can follow a value are never units: source, se and to. A unit is only taken when what follows it can end a value (the end of the line, a comma, a closing bracket, an interval, ±, @, a comment, source or se), which is what keeps { x: 330 y: 230 } reading as two attributes.
Warning: In an attribute value, writeper 100000orper 100 000, notper 100,000: the comma ends the value. Hyphenated unit names such asperson-yearscannot follow a number in an attribute; writepy(orpyrs) for person-years. Write the US fluid ounce asfloz, notfl oz.
Supported units
| Family | Units (aliases in brackets) |
|---|---|
| Mass | g (gram, grams), with prefixes such as mg, µg, kg; lb (lbs, pound, pounds); oz (ounce, ounces) |
| Length | m (metre, meter), with prefixes such as mm, cm, km; in (inch, inches); ft (foot, feet) |
| Time | s (sec, second, seconds) with prefixes such as ms; min (minute, minutes, mins); h (hr, hrs, hour, hours); d (day, days); wk (week, weeks, wks); mo (month, months, mos); y (yr, yrs, year, years) |
| Amount and concentration | mol (mole, moles) with prefixes; M (molar) with prefixes such as mM, µM; U enzyme units with prefixes; kat (katal) |
| Volume | L (l, litre, liter) with prefixes such as mL, dL; floz (US fluid ounce) |
| Pressure | Pa with prefixes; mmHg; torr; atm; bar with prefixes; cmH2O |
| Temperature | K (kelvin); °C (degC, celsius); °F (degF, fahrenheit) |
| Energy, power, electricity, radiation, light | J, W, N, Hz, V, Ω (ohm), A (amp, ampere), cal (so kcal), Gy (gray), Sv (sievert), Bq (becquerel), all with SI prefixes; cd (candela) without |
| Counting labels | participants (participant, person, persons, people, patient, patients, subject, subjects), events, studies (study, trial, trials), cases, deaths, cells, copies, counts, observations (obs), beats, breaths, doses; Eq with mEq; IU |
| Rates of counts | bpm (beats/min) |
| Person-time | py and pyrs for person-years. person-years, person-months and person-days (and their patient-, participant- and subject- spellings) are understood inside an expression's bracketed unit, such as 4[events/person-years] |
| Ratios | % (percent, pct), ‰ (permille), ppm, ppb, proportion (fraction, prop), p (a p-value), probability (prob, Pr) |
Word spellings of three or more letters may differ in case (Days, MOL). Short symbols keep their case: mM is millimolar and Mm megametre.
Some conventions to know: a month is one twelfth of a 365.25-day year, so 3 mo is 13.04 weeks, not 12; mmHg and torr differ in the eighth significant figure; a temperature offset applies only to an absolute temperature, so °C/min is a rate of change; counting labels are dimensionless but are not interchangeable (events/participants is a rate, while events + participants is refused); and Eq and IU cannot be converted to moles or mass, because that needs a substance-specific factor.
Refused symbols
| You wrote | What the Lab says |
|---|---|
C | "C is ambiguous — write °C for Celsius or coulomb (not supported) for charge." |
F | "F is ambiguous — write °F for Fahrenheit." |
cc | "cc is ambiguous — write mL (1 cc = 1 mL)." |
| Anything not in the table | "Unknown unit furlongs. Units must be built from the known table (mg, mL, mmHg, mmol/L, wk, %, per 100000, …); counting labels like events or participants are declared there too." |
These are warnings on the attribute ("Unit x on key is not recognised: … The number is kept; the unit is carried through as text."). The number is kept; the unit is just not checked.
Plausibility checks
Some values are physically impossible and are errors: a negative count of a counting unit, a duration below zero, a temperature below absolute zero, a proportion or probability outside 0 to 1, a p-value outside 0 to 1. Others are merely implausible and are warnings, against these ranges:
| Unit | Plausible range | Context given |
|---|---|---|
mmHg | 20 to 400 | Human blood pressure |
°C | −90 to 200 | Laboratory and environmental temperatures |
K | 0 to 10,000 | Temperatures outside astrophysics |
kg/m^2 | 8 to 100 | Body-mass index |
beats/min | 10 to 350 | Heart rate |
breaths/min | 2 to 90 | Respiratory rate |
g/dL | 0 to 30 | Haemoglobin, albumin |
mmol/L | 0 to 1,000 | Clinical chemistry |
cells/µL | 0 to 10,000,000 | Cell counts |
copies/mL | 0 to 10^12 | Viral load |
U/L | 0 to 100,000 | Serum enzymes |
Gy | 0 to 1,000 | Absorbed radiation dose |
y | 0 to 150 | Human age or follow-up |
A negative value of a quantity that cannot be negative (a pressure, a mass) is also a warning: "-4.2 mmHg is negative, and pressure is not. If this is a change or a difference, name it as one."
A percentage gets three extra checks, but only in attributes declared as percent or estimate: above 100 ("150% exceeds 100. A percentage of a whole cannot; a relative change can — label it as a change if that is what this is."), below zero, and a note when a tiny percentage looks like a proportion ("0.1% is 0.001 of the whole — one part in 1000. If this is a proportion, write 10% or change the unit to proportion."). A % on any other attribute is never questioned.
Tip: For a difference measure such as a mean difference in blood pressure, put the unit in the block'sunit:attribute (estimate e { measure: md, value: -4.2 [-7.3, -1.1], unit: "mmHg" }) rather than on the number, so the blood-pressure plausibility range does not apply to a change.
Comparing numbers in different units
Wherever the Lab adds or compares numbers (a cohort flow, an arm sum, an expression), it uses one rule:
- If no number carries a unit, the numbers are compared as written.
- If every unit present is
%, they are also compared as written. - Otherwise every number must be the same kind of quantity, or the comparison is refused with a unit error and no arithmetic claim is made.
- Compatible numbers are converted to the first one's unit, so
1500 participantsminus300 participantsis 1200, and128 per 1000reconciles with12.8%. - A plain number beside a counting label is read as that count. A plain number beside a ratio unit is refused rather than guessed, because
0.12beside%could mean 0.12% or 12%: "Ambiguous scale: … Give…a unit".
Uncertainty
An estimate can carry its uncertainty in the same value. The Lab fills in the missing half (the standard error from an interval, or the interval from a standard error), on the right scale, and checks what cannot be true.
The notations
| Notation | Example | Meaning |
|---|---|---|
| Interval in brackets | 0.68 [0.51, 0.90] | Point estimate and interval |
| Interval in prose | 0.68 (0.51 to 0.90) | The same. Either bracket style takes either , or to |
| Plus or minus | 12.4 ± 0.8 or 12.4 +/- 0.8 | A symmetric half-width on the scale you wrote it |
| Standard error | 0.42 se 0.11 | Point and standard error |
| Coverage | … @ 90%, … @ 0.9 or … @ 90 | Interval coverage. The default is 95%. A bare number above 1 is read as a percentage |
A unit may follow the point estimate: 4.2 mmHg [1.1, 7.3]. Units on the bounds are accepted and ignored. The whole notation must be on one line.
Ratio measures and the log scale
When a block says its measure is a ratio (rr, or, hr, irr, rrr, ratio, gmr, sir or smr) or says scale: log, its intervals are treated on the log scale: the standard error is the standard error of the log ratio, the interval is asymmetric, and every bound must be above zero. A ratio of 0 or below is an error: "a ratio measure cannot be 0 — a risk, odds or hazard ratio is strictly positive. Set scale: identity if this is a difference."
Two ways to write an estimate
The estimate kinds (estimate, effect, contrast, meta, subgroup) accept either one value or separate parts:
estimate hr_os { measure: hr, value: 0.68 [0.51, 0.90] }
estimate hr_pfs { measure: hr, point: 0.71, lo: 0.58, hi: 0.87, p: 0.001 }
Both are checked the same way. Two differences matter:
- An estimate written with separate
point,lo,hiorseis also checked against its ownp:. If the interval excludes no effect but the p-value says not significant (or the reverse), you get "the interval and the p-value disagree … One of the two was copied from a different analysis." A small band around α is allowed for rounding. - Expressions see the interval of an inline
value:but not of separate parts. Usingsep.pointin an expression gives a note that the result "was computed without the uncertainty ofsep.point", with the advice to write the estimate inline.
Writing both an inline value: and separate parts that complete an estimate (a point with lo/hi or se), and having the two points disagree, is a warning: "twice states its estimate twice and the two disagree: value says … and point says …. Keep one of them".
Use level: 0.95 (a fraction) on the block when you need a coverage level with separate parts; level: 95 is an error because the attribute takes a fraction from 0 to 1.
What is checked in an estimate
| Problem | Message |
|---|---|
| Lower bound above upper | "Interval is inverted: lower 2 is above upper 0." |
| Point outside its interval | "Point estimate 0.9 lies below its own lower limit 1.1." (or above its upper limit) |
| Negative standard error | "Standard error must be finite and ≥ 0 (got …)." |
| Coverage not between 0 and 1 | "a coverage level must lie strictly between 0 and 1 — write @ 95% or @ 0.95" |
| A ratio bound at or below zero | "A log-scale (ratio) quantity cannot have lower limit 0 — ratios are strictly positive." |
| Degrees of freedom not above zero | "Degrees of freedom must be > 0 (got …)." |
[ or ( after a number, followed by a number, that is not a valid interval (such as 1 [2]) | "An interval after a number must be written [lo, hi] or (lo to hi)." The "Unexpected token" errors for the stray characters follow it |
± with nothing after it | "± must be followed by the uncertainty, e.g. 12.4 ± 0.8." |
@ without an uncertainty before it | "@ sets the coverage of an uncertainty and must follow one, e.g. 0.68 [0.51, 0.90] @ 90%." |
When df is given on the block, intervals use the t distribution rather than the normal.
Expressions (derived values)
Any attribute value that starts with = is an expression, computed from the rest of the document every time it changes:
cohort randomised { n: 1200 }
cohort analysed {
n: = randomised.n - excluded.withdrew
from: randomised
excluded: { withdrew: 40 }
}
outcome death_30d {
metric: "30-day mortality"
control: { events: 72, n: 600, rate: = events / n * 100 }
}
funnel_step trials { n: 2400, title: "Started a trial" }
funnel_step paid { n: 312, from: trials, title: "Paid" }
kpi conversion { title: "Trial to paid", baseline: = pct(paid.n, trials.n) }
A derived number cannot go stale: when a count is corrected, everything computed from it follows.
Where an expression can go
- Any attribute of any block, and any entry one level inside an object (
control: { rate: = … }). - The expression runs to the end of the line, a comment, a comma outside brackets, or a closing brace, so
{ a: = x + 1, b: 2 }works on one line. Without the comma, everything up to the end of the line would be read as part of the expression. - An expression must produce a number, except in
check'sthat:, which must producetrueorfalse. Atrue/falseattribute anywhere else cannot be derived: "risk_tableholds a truth value, but nothing reads the answer to a condition written there … Write the answer out, or state the condition ascheck … { that: = … }". - Expressions are evaluated in dependency order, so they may refer to each other in any order. A loop is an error: "Circular definition:
b.n→c.n→b.n. One of these has to be written out as a number."
Names
| Name | Resolves to |
|---|---|
events (inside an object such as control: { … }) | The entry of that same object first, so rate: = events / n uses the control group's numbers |
n (a single name) | An attribute of the block the expression is in |
screened.n, death_30d.control.events | An attribute of the named block, anywhere in the document |
true, false, null | Literals |
"control" or 'control' | Text, for comparisons such as if(arm == "control", 1, 2) |
A path that names nothing is an error: "nope.n does not resolve to a value — check the block id and attribute name."
Operators
From loosest to tightest binding:
| Operators | Meaning | Notes |
|---|---|---|
c ? a : b | If c then a, else b | Right to left |
or | Either is true | Both sides must be true or false |
and | Both are true | |
not | Negation | ! is not accepted: "Use not for negation, and != for inequality." |
==, != | Equal, not equal | Compare numbers (in compatible units), text or truth values. = is not accepted: "Use == to compare, not =." |
<, <=, >, >= | Order | Numbers only. Comparisons do not chain: a < b < c is "Comparisons do not chain — write a < b and b < c instead." |
+, - | Add, subtract | Units are converted when compatible (5 mg + 1 g is 1005 mg); different quantities are refused |
*, /, % | Multiply, divide, remainder | % is always the remainder in an expression (12 % 5 is 2) |
Unary -, + | Sign | Binds looser than ^, so -2^2 is −4 |
^ | Power | Right to left, so 2^3^2 is 512. An exponent cannot carry a unit |
( … ) | Grouping |
There is no truthiness: a number where true or false is needed is an error ("The condition of if must be true or false, got a number — this language has no truthiness, write the comparison out."). Juxtaposition is never multiplication: 2 randomised.n is an error ("Unexpected randomised after the end of the expression."), not "twice randomised"; write 2 * randomised.n.
Numbers and units inside expressions
| Write | Meaning |
|---|---|
5 mg | A number with a one-word unit |
5[mg/kg/day] | A number with any unit, in square brackets. Needed for compound units |
12[%] or 12 percent | A percentage. 12% would be read as "12 remainder …" |
1e9, 2.5e-3 | Exponent form |
Arithmetic in expressions is exact for ordinary decimals: 0.1 + 0.2 is exactly 0.3, not 0.30000000000000004.
Built-in functions
| Function | Arguments | Returns |
|---|---|---|
sum(…) | Any number of values, or a selector | The total. The empty sum is 0 |
mean(…) | At least one value, or a selector | Arithmetic mean |
median(…) | At least one value, or a selector | Middle value; the mean of the two central values when the count is even |
min(…), max(…) | At least one value, or a selector | Smallest, largest |
count(…) | Any number of values, or a selector (no field needed) | How many values are present |
sd(…) | At least two values, or a selector | Sample standard deviation (n − 1) |
se(…) | At least two values, or a selector | Standard error of the mean, sd/√n |
abs(x) | 1 | Magnitude |
round(x), round(x, d) | 1 or 2 | Rounds half away from zero, optionally to d decimals (round(2.675, 2) is 2.68). d must be a whole number |
floor(x), ceil(x) | 1 | Round down, round up |
sqrt(x) | 1 | Square root; a negative number has no real value |
ln(x), log10(x) | 1 | Natural and base-10 logarithms; x must be above 0, and should be dimensionless |
exp(x) | 1 | e to the power of x |
pow(b, e) | 2 | Same as b ^ e |
clamp(x, lo, hi) | 3 | x limited to between lo and hi |
if(cond, a, b) | 3 | a when cond is true, else b. Only the branch taken is evaluated |
coalesce(a, b, …) | At least 1 | The first argument that resolves to a value |
pct(part, whole) | 2 | part / whole × 100, in % |
ratio(a, b) | 2 | a / b |
rate_per(events, population, per) | 3 | events / population × per, such as a rate per 100,000 |
The wrong number of arguments is an error ("round takes 1–2 arguments, got 3."), as is a name that is not a function ("foo is not a built-in function. Available: sum, mean, …").
Aggregates over blocks
sum, mean, median, min, max, count, sd and se can run over a set of blocks instead of a list of values. Write a selector, a comma, and the attribute name in quotes:
cohort randomised { n: 1200 }
arm placebo { n: 600, from: randomised }
arm drug_x { n: 600, from: randomised }
check arms { that: = sum(kind:arm, "n") == randomised.n }
kpi large_arms { title: "Arms over 500", baseline: = count(where(kind:arm, n > 500)) }
| Selector | Picks |
|---|---|
kind:arm (or kind:"arm") | Every block of that kind, anywhere in the document |
children(trial) | The blocks directly inside trial |
descendants(trial) | Every block inside trial, at any depth |
ids(placebo, drug_x) | Exactly the named blocks |
where(selector, test) | The blocks of selector that pass test |
A where test compares a field with a literal (n > 500, label == "control", "role" == "primary"), and tests can be combined with and, or, not and parentheses. The field may be kind, id, or any attribute (dotted for an object entry, such as control.events). The right-hand side must be a literal number, text, true, false or null.
Blocks that lack the field are skipped. A sum over a selector that matches nothing is 0 with a warning ("Nothing matched over kind:sharehodler with a shares, so this total is 0. Check the selector."); every other aggregate over nothing is an error ("mean needs at least one value; nothing matched over kind:widget."). The field must be quoted ("The field of an aggregate must be a quoted name, e.g. sum(kind:arm, "n").") and every aggregate except count needs one. Values in different units are converted when they are the same kind of quantity; values that cannot be reconciled are left out of the total with a warning saying so.
Uncertainty through expressions
An expression that uses an inline estimate (value: 0.68 [0.51, 0.90]) carries its uncertainty through +, -, *, /, ^, ln, exp, sum and mean. For example, md1.value + md2.value with intervals [1.1, 7.3] and [0.5, 3.5] gives 6.2 with its own interval. A plain number you write (the 2 in x * 2) counts as exact.
Other operations keep the point estimate and drop the interval, with a note saying so ("median has no uncertainty algebra, so the result is a point estimate and the interval stops here."). Estimates on different scales cannot be combined: adding a ratio to a difference, or computing 1 - hr.value, is refused ("Cannot subtract these two estimates — one is a ratio measure (0.68) and the other is the plain number 1 … state it as an estimate of its own."). Aggregates over a selector use the numbers alone and carry no interval.
Limits
| Limit | Value |
|---|---|
| Nesting depth | 64 levels ("Expression nests more than 64 levels deep.") |
| Length | 20,000 characters ("Expression is … characters; the limit is 20000.") |
| Size | About 2,000 grammar steps; a very long chain such as 1+1+1+… stops with "Expression is too large to analyse." Use an aggregate instead |
Checks
A check block states a rule about your document. The Lab runs it after everything else is computed and reports a violation on the status badge like any other issue.
cap_table acme { title: "Acme Ltd", currency: "GBP" }
shareholder founders { name: "Founders", shares: 7000000 }
shareholder seed { name: "Seed investors", shares: 2000000 }
option_pool pool { shares: 1000000 }
check fully_diluted {
title: "Fully diluted share count"
that: = sum(kind:shareholder, "shares") + pool.shares == 10000000
else: "Shares and pool total {sum(kind:shareholder, \"shares\") + pool.shares}, not 10,000,000."
severity: error
about: acme
}
| Attribute | Meaning |
|---|---|
that | The condition, as an expression that produces true or false. Inserted checks start from a real condition such as = sum(kind:arm, "n") == 100 |
else | The message to show when it fails. { … } holes are evaluated against the document (write the expression without =). {{ and }} print literal braces |
severity | error (the default) or warn. It grades a violation the check decided |
about | A block the rule is about, offered as a second place to look |
title | A readable name |
This document passes. Change the seed shareholder to shares: 1500000 and the badge shows the error "Check fully_diluted: Shares and pool total 9500000, not 10,000,000." Without else, the Lab prints the condition and the numbers it compared, for example "Check fully_diluted: sum(kind:shareholder, "shares") + pool.shares == 10000000 is false — …".
What makes a check fail to run, always reported as an error whatever its severity:
| Problem | Message |
|---|---|
No that | "Check x states no that: — it asserts nothing, so it can never fail and its silence says nothing about the document. Write the condition, e.g. that: = count(kind:arm) > 0." |
that is a constant | "Check x: that is true, which is a constant rather than a condition — it cannot tell you anything about the document. Write it as an expression: that: = …." |
that produces a number or nothing | "x.that could not be run: = … produced the number 900 rather than a true/false answer. A condition that cannot be decided has NOT held." |
A severity that is not error or warn | Reported, and the violation is shown as an error anyway |
A hole in else that cannot be computed | The hole prints as ?, with a warning naming it |
A selector that matches nothing makes a sum 0 and warns, which is usually why a check you believe in comes back false.
The arithmetic the Lab checks
Some rules are built in for specific kinds. They are errors when a number cannot exist and warnings when two numbers disagree.
| Rule | Applies to | Severity | Message (example) |
|---|---|---|---|
| Flow balances | A cohort with n and from:: the parent's n minus the sum of its excluded entries must equal its own n | Error | "Arithmetic inconsistency: screened.n (1502) − sum(excluded) (238) = 1264, but randomised.n is 1200." Without excluded: "… does not match … — add an excluded object to account for the difference of 302." |
| Arms add up | All arm blocks with the same from: must sum to that cohort's n | Error | "Arm allocation does not match parent cohort: randomised.n = 1200, but the arms drawn from it sum to 1150 (placebo=600 + drug_x=550)." |
| Counts can exist | n on a cohort or arm, and each excluded entry | Error | "x.n is -5 — a count of participants cannot be negative." "y.n is 100.5 — a count of participants must be a whole number." "… an exclusion removes people from a box, so it cannot be negative." |
| Outcome counts can exist | control and treatment in an outcome | Error | "Outcome o.control: 72 events among 50 participants is more events than people. No rate, effect or p-value can be computed from counts that cannot exist." |
| Fractional outcome counts | The same | Warning | "… which is not a whole number of people. If these are imputed or weighted counts, say so in test …" |
| Outcome bigger than its arm | An outcome group matched to an arm by name (or by arm: in the object) | Warning | "… analyses 80 participants, but arm control has n = 50 … If the outcome is counted per eye, lesion or episode, say so in metric." |
| Rate matches counts | A rate in control or treatment with events and n | Warning | "Outcome o.treatment: declared rate 9% doesn't match 48/600 = 8.00%." Rates written per 100, per 1000 or percent are understood |
| p matches the test | test: "chi-squared" or "Fisher exact" (and their usual spellings) with whole counts | Warning | "p: 0.9 is not what chi-squared gives for 72/600 against 48/600 — that is 0.021 or 0.027." Both the plain and continuity-corrected chi-squared values, and Fisher's, are accepted at the precision you printed |
| Effects match counts | rr, or, rd, nnt on an outcome with counts | Warning | "rr: 2.5 [2, 3.1] is not what its own counts give — 48/600 against 72/600 is RR 0.667 (95% CI 0.471 to 0.943). An adjusted estimate may differ from the crude one, but not to the point of excluding it …" |
| Data columns exist | A column with of: a dataset, or any block with dataset: and a column: or …_column: text, when rows are bound on the Data bench | Error | "age binds to column "agee", which is not in dataset "trial" — did you mean "age"? The figure would draw a blank." |
| Data size matches | rows: and columns: on a dataset, when rows are bound | Warning | "trial_data declares 240 rows but the supplied data has 236 — the figure and the data have drifted apart." |
The arm and outcome effect checks compare intervals, not points, so an adjusted estimate that differs from the crude one is only reported when it excludes it. Tests other than chi-squared and Fisher (a t-test, a log-rank test, a mixed model) are not recomputed.
The Reporting standards checks add many more rules (the ICER follows from costs and effects, a 2×2 table adds up, and so on) when you score a document against a checklist.
View lines
A view is one figure drawn from the document.
The one-line form
view flow: consort(trial)
view survival: km(os)
view timeline: gantt
view rob: rob_traffic_light(rob2)
view, then the view's name, a colon, a renderer, and optionally arguments in parentheses separated by commas. Arguments may be ids, quoted strings or numbers. Most renderers take the id of the block to draw; the risk-of-bias figures take an instrument name instead. A view line can sit at the top level or inside a block (inside a block it must have a name).
The block form
view figure_1 {
renderer: "forest"
args: ["pooled"]
title: "Figure 1"
caption: "Risk of the primary outcome, random-effects meta-analysis."
alt: "Forest plot of eleven trials; pooled risk ratio 0.78."
width: 183 mm
publish: { journal: "nature", column: double }
}
The block form takes the same renderer and arguments plus presentation and publishing settings (title, caption, alt, width, height, theme, palette, publish, type_pt, line_pt, guideline). Write renderer: and each argument as quoted strings: a bare word in renderer: is not read, and the view then falls back to the CONSORT renderer. A block-form view without renderer: is an error ("view is missing required attribute renderer.").
What is checked in a view line
| Problem | Severity | Message |
|---|---|---|
| Unknown renderer | Error | "View v names renderer kaplan, which no renderer answers to — it would render as a placeholder reading "No view renderer named kaplan" rather than fail." with a suggestion within two letters, or the first renderer names |
| Argument names no block | Warning | "View v passes zzz to consort, but no block with that id is declared — the view would draw an empty figure rather than say so." (numbers and risk-of-bias instrument names are not checked) |
| No name | Warning | "This view has no name, so it is listed as untitled and nothing can address it — not the remembered tab, not a share link, not a panel child. Give it an id: view consort : …." |
Two views with the same name are a duplicate-id error ("Duplicate id "a" — every block id must be unique."); until you rename one, the second is listed as a-2 (then a-3 and so on). Several unnamed views are listed as untitled, untitled-2 and so on.
Renderers
The Lab has 36 renderers, most with aliases; there are 101 accepted names in all. Each renderer, the blocks it is built from, its argument and its messages are documented on Lab views and renderers.
| Field | Renderers |
|---|---|
| Trial and review flow | consort, prisma |
| Clinical and protocol | km (kaplan_meier, survival), table_one (baseline, characteristics), clinical_timeline (timeline, case_timeline), spirit_schedule (spirit, schedule_of_assessments, soa) |
| Diagnostics and prediction | roc (auc, pr_curve), calibration (calibration_plot, reliability_diagram), decision_curve (dca, net_benefit) |
| Evidence synthesis | forest (forest_plot), funnel_plot (small_study, publication_bias), rob_traffic_light (rob, robvis, risk_of_bias), rob_summary_bar (rob_summary), grade_sof (sof, summary_of_findings), appraisal_table (amstar, appraisal, checklist_table), intervention_table (tidier, tidier_table, intervention_description) |
| Statistics and quality improvement | raincloud (distribution, violin), control_chart (spc, run_chart, shewhart) |
| Qualitative and survey | theme_map (themes, qualitative_themes, coreq), item_map (instrument_map, survey_map) |
| Health economics | ce_plane (icer, cost_effectiveness) |
| Composition and illustration | panel (multi_panel, figure_panel), figure (schematic), scene (scene3d, isometric) |
| Machine learning and laboratory | ablation_table (ablation), experiment_flow (experiment) |
| Business, engineering and other | gantt (roadmap), c4_container (c4, container), funnel, okr_grid (okr), captable (cap_table, captable_waterfall), risk_matrix (stride, threat_matrix), fmea_table (fmea, rpn_table), supply_map (supply_chain, supply_network), rubric_grid (rubric, criteria_grid), clause_map (agreement_map, contract_map) |
Note the two near-collisions: funnel is the business conversion funnel (the meta-analysis funnel plot is funnel_plot), and timeline is an alias of the clinical case timeline (the project timeline is gantt).
A note whose text contains "Illustrative values" or "(illustrative)" is drawn in a band below every view.
Block kinds reference
Each kind below lists its attributes with their type, the rules the Lab enforces, and what they mean. "Takes an id" means a block without one is warned about. "Typical children" are the kinds that nest inside it without a warning. "Read by" names the views that draw it. A rule breach is an error unless noted; the messages are listed under Messages reference.
Shared word lists
Several attributes take a word from one of these lists. Case and punctuation are ignored when matching.
| List | Words |
|---|---|
| Effect measures | rr, or, hr, irr, rrr, ratio, gmr, sir, smr (ratio measures, drawn on a log scale), rd, ard, arr, nnt, nnh, md, smd, mean, median, proportion, rate, count, auc, beta, slope, correlation, r2, kappa, icc, custom |
| Risk-of-bias judgements | low, some_concerns, moderate, high, serious, critical, probably_low, probably_high, unclear, no_information |
| Appraisal tools | rob2, robins_i, robins_e, quadas2, quips, prob_ast, newcastle_ottawa, robis, amstar2, care, custom |
| Reporting standards | consort, prisma, arrive, cheers, strobe, spirit, stard, tripod, srqr, coreq, moose, remark, agree, care, squire, tidier, prisma_abstracts, consort_harms, tripod_ai, claim, equator, custom |
| Validation types | apparent, internal, bootstrap, cross_validation, split_sample, external, temporal |
| Scale types | linear, log, symlog, pow, sqrt, time, band, point, bin, quantile, threshold |
| Built-in palettes | okabe-ito, tol-bright, tol-muted, tol-light, tol-vibrant, tol-high-contrast, tol-medium-contrast, greyscale-safe, viridis, cividis, magma, inferno, plasma, blues, greens, oranges, purples, greys, rdbu, brbg, piyg, rdylbu, vik-like, jet |
Blocks that do not need an id
note, panel, view, caption, legend, alt, licence and the drawing primitives (shape, label_2d, arrow_2d, annotation, box3d, sphere3d, cylinder3d, plane3d, edge3d, label3d). Every other registered kind takes an id.
Required attributes
Only these attributes are required; leaving one out is an error. Kinds not listed have no required attributes, and the reporting standards say in their own words what is missing.
| Kind | Required |
|---|---|
note | text |
cohort, arm, funnel_step | n |
outcome | metric |
milestone | date |
task, kpi, threat, control, clause | title |
eval | model, dataset, metric |
label_2d | text, x, y |
annotation, label3d, item | text |
shareholder | name, shares |
option_pool | shares |
round | name, raise |
asset, construct, sc_node, criterion, party | name |
intervention | name, cost, qalys |
instrument, fmea, rubric, agreement | title |
failure_mode | component, mode |
mitigation | mode, action |
supply_chain | product |
sc_link | from, to |
level | criterion, label |
obligation | party, action |
view (block form) | renderer |
Core blocks
Four kinds belong to no domain: notes, layout panels, your own rules (check) and views.
note — Annotation. Free-form annotation attached to another block. The id is optional. Drawn below any view when its text marks the values as illustrative.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
text | Text | Required | The note itself. A note whose text contains "Illustrative values" or "(illustrative)" is drawn below every view |
anchor | Block id | The block the note is about |
panel — Layout panel. Composes a named view into a multi-panel figure — grid position, spans, shared axes, panel letter. The id is optional. Read by the panel view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Title of the composed figure (on the container panel) | |
view | Word | The view this panel draws. A panel with view: is a child; a panel without one is the container | |
label | Text | Panel letter as printed — a, B, (iii) | |
letter | Word | Panel letter when written bare: letter: a | |
label_style | Word | Panel-letter house style — lowercase, uppercase, lowercase-bold, uppercase-bold, numeric | |
label_position | Word | Where the panel letter sits — top-left, top-right, bottom-left, bottom-right, above, outside | |
rows | Number | Grid rows this panel's children occupy | |
cols | Number | Grid columns | |
row | Number | 1-based grid row this panel occupies | |
col | Number | 1-based grid column | |
row_span | Number | Rows this panel spans (default 1) | |
col_span | Number | Columns this panel spans (default 1) | |
share_x | true/false | Reuse the neighbouring panel's x scale and hide the duplicate axis | |
share_y | true/false | Reuse the neighbouring panel's y scale | |
gutter | Quantity | Space between panels — 3 mm, 12 px | |
gutter_x | Quantity | Horizontal gutter, when it differs from gutter | |
gutter_y | Quantity | Vertical gutter | |
width | Quantity | Panel width — plain number, or 88 mm for a journal column | |
height | Quantity | Panel height | |
align | Word | Horizontal alignment inside the grid cell — left, center, right, justify | |
caption | Text | Panel-level caption; the figure caption lives on caption | |
alt | Text | Alt text for this panel alone | |
publish | Object | Journal target for the composed figure, as an object | |
type_pt | Object | Type sizes in points, keyed by role: { axis_tick: 6, panel_label: 8 } | |
line_pt | Object | Line weights in points, keyed by role: { axis: 0.4, series: 0.75 } |
check — Invariant. A rule you state about this document, the message to show when it is broken, and how loudly to say it. See Checks. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
that | true/false | The condition that must hold, as an expression such as = sum(kind:shareholder, "pct") == 100. Anything that does not produce true or false is reported as a check that could not be run | |
else | Text | What to say when it fails, in your own words. { … } holes are evaluated against the document, so the message can quote the number that broke it | |
severity | Word | One of error, warn | How loudly a violation is reported: error (the default) or warn. A check that could not be run is always an error, whatever this says |
about | Block id | The block this rule is about, offered as a second place to look | |
title | Text | A readable name for the rule |
view — View. One figure drawn from the document. Usually written on one line as view name: renderer(args); see View lines. The id is optional.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
renderer | Text | Required | The renderer to draw with. Set for you by the view name: renderer(...) form |
args | List of block ids | The renderer's arguments. Set for you by the colon form; write them as quoted strings in the block form | |
title | Text | Title of the figure | |
caption | Text | Figure caption; a caption block can hold a longer one | |
alt | Text | Alt text — required by most journals and every screen reader | |
width | Quantity | Rendered width — plain number, or 183 mm for a journal | |
height | Quantity | Rendered height | |
theme | Word | light, dark | |
palette | Word | Palette id, or the id of a palette block | |
publish | Object | Journal target: { journal: "nature", column: double, width_mm: 183, format: "pdf" } | |
type_pt | Object | Type sizes in points by role: { axis_tick: 6, panel_label: 8 } | |
line_pt | Object | Line weights in points by role: { axis: 0.4, series: 0.75 } | |
guideline | Word | Reporting standard this figure claims — see the guideline block |
Clinical trials, protocols and case reports
Trial flows, outcomes, case timelines and protocol schedules. The Lab checks the arithmetic of cohort and arm blocks and the rates, p-values and effects of outcome blocks (see The arithmetic the Lab checks).
study — Study. The study a figure reports: its design, place, period and registration. Takes an id. Typical children: cohort, arm, outcome, view, note. Read by the consort, rob_traffic_light, rob_summary_bar, appraisal_table and intervention_table views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
design | Text | Study design, such as a randomised trial or an observational cohort | |
location | Text | Where the study ran | |
period | Text | When the study ran | |
registry | Text | Trial registration, such as an NCT identifier | |
title | Text | Study title | |
followup_period | Text | When follow-up ended and why (CONSORT item 14b — why the trial stopped, or the date of last follow-up) |
cohort — Cohort. One box of a participant flow: how many people, which box they came from, and why the others left. Takes an id. Read by the consort, prisma and experiment_flow views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
n | Number | Required | Number of participants |
from | Block id | Parent cohort this was drawn from | |
excluded | Object | Reasons-keyed counts of exclusions | |
label | Text | Box label in the flow diagram | |
stage | Text | Which CONSORT flow stage this box belongs to — enrolment, allocation, received, followup or analysis | |
analysis | Text | Analysis population this cohort represents — intention-to-treat, per-protocol, safety (CONSORT item 16) |
arm — Trial arm. One trial arm: how many were allocated to it and what they received. Takes an id. Read by the consort, experiment_flow, intervention_table and spirit_schedule views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
n | Number | Required | Participants allocated to this arm |
from | Block id | The cohort the arm was allocated from. Arms that share a from: must sum to it | |
intervention | Text | What this arm received | |
label | Text | Arm label in the figure |
outcome — Outcome. One outcome, with each group's counts, the test, the p-value and the effect estimates. Takes an id. Read by the grade_sof, experiment_flow and spirit_schedule views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
metric | Text | Required | What was measured, in words |
control | Object | The control group's numbers, as an object such as { events: 72, n: 600, rate: 12% } | |
treatment | Object | The treatment group's numbers, in the same shape as control | |
test | Text | The statistical test used. chi-squared and Fisher exact (and their usual spellings) are recomputed from the counts | |
p | Number | The p-value as reported | |
role | Text | Pre-specified role — primary, secondary, exploratory or safety (CONSORT item 6a distinguishes primary from secondary) | |
timepoint | Text | When the outcome was measured ("24 weeks after randomisation") | |
assessed | Text | How the outcome was ascertained — the assay, instrument or adjudication (CONSORT item 6a). Not a count; the numbers analysed live on the analysis-stage cohorts | |
rr | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | Risk ratio with its confidence interval |
or | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | Odds ratio with its confidence interval |
rd | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | Risk difference with its confidence interval |
hr | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | Hazard ratio with its confidence interval |
md | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | Mean difference with its confidence interval |
nnt | Number | Number needed to treat, derived from the risk difference |
timeline — Case timeline. The episode of care laid out against time (CARE item 7) — a title and the origin every event's time is counted from. Takes an id. Read by the clinical_timeline view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | What the timeline shows — Timeline of the episode of care | |
origin | Text | What the time axis is measured from — Day 0 is the first dose | |
orientation | Text | horizontal or vertical; chosen from the number of events when absent | |
case | Block id | The case_report this timeline belongs to, when a document holds more than one |
timeline_event — Timeline event. One dated event in a clinical case — when it happened, what happened, and the phase of care it belongs to. Takes an id. Read by the clinical_timeline view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
at | Text | When it happened — Day 26, Week 11 after withdrawal, 2024-03-04 | |
date | Text | A calendar date, when the event is dated rather than counted from the origin | |
day | Number | Days from the timeline's origin, as a bare number | |
time | Text | Another spelling of at, read when at is absent | |
unit | Text | Unit of a bare numeric time — d, wk, mo, y | |
label | Text | What happened, in one line | |
title | Text | Another spelling of label | |
text | Text | Another spelling of label | |
phase | Text | Phase of care — presentation, diagnosis, intervention, outcome, follow-up | |
category | Text | Another spelling of phase | |
type | Text | Another spelling of phase | |
kind | Text | Another spelling of phase | |
status | Text | Another spelling of phase | |
detail | Text | A second line under the label — a result, a dose, a finding | |
note | Text | Another spelling of detail | |
timeline | Block id | The timeline this event belongs to, when a document holds more than one | |
of | Block id | Another spelling of timeline |
spirit_schedule — SPIRIT schedule. The SPIRIT 2013 item 13 figure — the study periods and time points a protocol's visits are scheduled against. Takes an id. Read by the spirit_schedule view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | The figure's title — Schedule of enrolment, interventions, and assessments | |
periods | List of labels | The time points across the top, each led by its code — "-t1 Screening (week -2)", "0 Allocation", "t1 Week 4", "Close-out" |
spirit_row — SPIRIT schedule row. One row of the SPIRIT schedule — an enrolment step, an intervention or an assessment, and the time points it happens at. Takes an id. Read by the spirit_schedule view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
section | Text | Enrolment, Interventions or Assessments — the three SPIRIT sections | |
label | Text | What happens at these visits — Eligibility screen, HbA1c (primary outcome) | |
title | Text | Another spelling of label | |
at | List of labels | The period codes this row is scheduled at — ["-t1", "0", "t2"] | |
placeholder | true/false | A starter row still to be replaced; drawn faint and counted as not yet written | |
schedule | Block id | The spirit_schedule this row belongs to, when a document holds more than one |
Statistics
Estimates and their intervals, pooled analyses, time-to-event data, prediction-model performance, raw distributions and study design. The estimate kinds (estimate, effect, contrast, meta, subgroup) share one shape; see Uncertainty.
estimate — Effect estimate. One effect size with its interval, measure type and scale — the atom every forest plot is built from. Takes an id. Read by the forest, funnel_plot and grade_sof views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
label | Text | How the estimate should be labelled on the figure | |
measure | Word | One of the effect measures | Effect measure |
scale | Word | One of identity, log | The scale of the interval. Every ratio measure needs log, or its interval is symmetric and wrong |
value | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | Point estimate and interval as one value |
point | Number | The estimate, on the display scale | |
se | Number | At least 0 | Standard error on the analysis scale — of log(point) when scale: log |
lo | Number | Lower interval bound, display scale | |
hi | Number | Upper interval bound, display scale | |
level | Number | From 0 to 1 | Interval coverage as a fraction — 0.95, not 95 |
p | Number | From 0 to 1 | p-value. Exactly 0 is unattainable; write p < 0.001 in a string |
n | Number | Whole number, 0 or more | Participants contributing to the estimate |
events | Number | Whole number, 0 or more | Events contributing to the estimate |
df | Number | At least 1 | Degrees of freedom; when present the interval uses t, not z |
unit | Text | Unit of a difference measure — meaningless for a ratio | |
weight | Percent | 92% or 0.92 | Weight in a pooled analysis |
null_value | Number | Where no effect sits — 1 for a ratio, 0 for a difference | |
expr | Expression | Written = … | Expression deriving the estimate from other blocks |
outcome | Block id | The outcome block this estimates | |
exposure | Word | Exposure / intervention the estimate is for | |
comparator | Word | What it is measured against — the reference group | |
adjusted | true/false | Adjusted for covariates rather than crude | |
covariates | List of labels | Covariates the model adjusts for | |
model | Text | Model that produced it — Cox, logistic, mixed | |
from | Block id | Block the numbers were computed from | |
dataset | Block id | Dataset the estimate is bound to |
effect — Effect size. An effect size stated on its own — the same shape as estimate, for documents that prefer the word. Takes an id. Read by the forest and funnel_plot views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
label | Text | How the estimate should be labelled on the figure | |
measure | Word | One of the effect measures | Effect measure |
scale | Word | One of identity, log | The scale of the interval. Every ratio measure needs log, or its interval is symmetric and wrong |
value | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | Point estimate and interval as one value |
point | Number | The estimate, on the display scale | |
se | Number | At least 0 | Standard error on the analysis scale — of log(point) when scale: log |
lo | Number | Lower interval bound, display scale | |
hi | Number | Upper interval bound, display scale | |
level | Number | From 0 to 1 | Interval coverage as a fraction — 0.95, not 95 |
p | Number | From 0 to 1 | p-value. Exactly 0 is unattainable; write p < 0.001 in a string |
n | Number | Whole number, 0 or more | Participants contributing to the estimate |
events | Number | Whole number, 0 or more | Events contributing to the effect |
df | Number | At least 1 | Degrees of freedom; when present the interval uses t, not z |
unit | Text | Unit of a difference measure — meaningless for a ratio | |
weight | Percent | 92% or 0.92 | Weight in a pooled analysis |
null_value | Number | Where no effect sits — 1 for a ratio, 0 for a difference | |
expr | Expression | Written = … | Expression deriving the estimate from other blocks |
outcome | Block id | The outcome block this effect is on | |
of | Block id | Block this effect belongs to | |
direction | Word | One of benefit, harm, none, unclear | Which direction favours the intervention |
favours | Word | Group the estimate favours, for the axis annotation | |
minimal_important_difference | Quantity | MID — the smallest change that matters clinically |
contrast — Contrast. A comparison between two named groups, carrying the contrast estimate and the test behind it. Takes an id. Read by the forest and funnel_plot views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
label | Text | How the estimate should be labelled on the figure | |
measure | Word | One of the effect measures | Effect measure |
scale | Word | One of identity, log | The scale of the interval. Every ratio measure needs log, or its interval is symmetric and wrong |
value | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | Point estimate and interval as one value |
point | Number | The estimate, on the display scale | |
se | Number | At least 0 | Standard error on the analysis scale — of log(point) when scale: log |
lo | Number | Lower interval bound, display scale | |
hi | Number | Upper interval bound, display scale | |
level | Number | From 0 to 1 | Interval coverage as a fraction — 0.95, not 95 |
p | Number | From 0 to 1 | p-value. Exactly 0 is unattainable; write p < 0.001 in a string |
n | Number | Whole number, 0 or more | Participants contributing to the estimate |
events | Number | Whole number, 0 or more | Events contributing to the contrast |
df | Number | At least 1 | Degrees of freedom; when present the interval uses t, not z |
unit | Text | Unit of a difference measure — meaningless for a ratio | |
weight | Percent | 92% or 0.92 | Weight in a pooled analysis |
null_value | Number | Where no effect sits — 1 for a ratio, 0 for a difference | |
expr | Expression | Written = … | Expression deriving the estimate from other blocks |
group_a | Word | First group — an arm/group id, or a bare label | |
group_b | Word | Second group; the estimate is a-versus-b | |
reference | Word | Which of the two is the reference (default group_b) | |
outcome | Block id | The outcome being compared | |
n_a | Number | Whole number, 0 or more | Participants in group A |
n_b | Number | Whole number, 0 or more | Participants in group B |
events_a | Number | Whole number, 0 or more | Events in group A |
events_b | Number | Whole number, 0 or more | Events in group B |
paired | true/false | Within-subject comparison | |
test | Text | Test used — t-test, log-rank, Fisher exact | |
adjusted | true/false | Adjusted for covariates rather than crude | |
alpha | Number | From 0 to 1 | Significance threshold used (e.g. 0.05) |
multiplicity | Word | One of none, bonferroni, holm, hochberg, benjamini_hochberg, tukey, dunnett, hierarchical | Multiplicity adjustment applied across contrasts |
meta — Meta-analysis. A pooled estimate over study-level estimates, with its heterogeneity and small-study diagnostics. Takes an id. Typical children: estimate, effect, subgroup, study, note, view. Read by the forest and funnel_plot views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Title of the meta-analysis | |
measure | Word | One of the effect measures | Pooled measure |
scale | Word | One of identity, log | The scale of the interval: log for every ratio measure |
model | Word | One of fixed, fixed_effect, common_effect, random, random_effects, inverse_variance, mantel_haenszel, peto, dersimonian_laird, reml, ml, paule_mandel, hartung_knapp, hksj, bayesian | Pooling model — a random-effects label commits the figure to a tau-squared estimator |
k | Number | Whole number, 0 or more | Number of studies pooled |
n | Number | Whole number, 0 or more | Total participants across studies |
point | Number | Pooled estimate on the display scale | |
se | Number | At least 0 | Standard error on the analysis scale |
lo | Number | Lower bound of the pooled interval | |
hi | Number | Upper bound of the pooled interval | |
level | Number | From 0 to 1 | Interval coverage as a fraction — 0.95, not 95 |
value | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | Pooled estimate and interval in one value |
i2 | Percent | 92% or 0.92 | I-squared — share of variability beyond chance |
tau2 | Number | At least 0 | Between-study variance on the analysis scale |
tau | Number | At least 0 | Between-study standard deviation |
q | Number | At least 0 | Cochran's Q |
q_df | Number | Whole number, 0 or more | Degrees of freedom of Cochran's Q |
p_heterogeneity | Number | From 0 to 1 | p-value of the heterogeneity test |
prediction_lo | Number | Prediction-interval bound — where the next study is expected | |
prediction_hi | Number | Upper prediction-interval bound | |
egger_p | Number | From 0 to 1 | Egger's test for small-study effects |
funnel_asymmetry | true/false | Funnel asymmetry was found | |
weight_by | Word | One of inverse_variance, sample_size, equal, mantel_haenszel, peto | How studies were weighted |
p | Number | From 0 to 1 | p-value for the pooled effect |
unit | Text | Unit of a difference measure | |
null_value | Number | Where the line of no effect is drawn — 1 for ratios, 0 for differences |
subgroup — Subgroup. A study-level or participant-level subgroup estimate, with the interaction test that licenses it. Takes an id. Read by the forest view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
label | Text | How the estimate should be labelled on the figure | |
measure | Word | One of the effect measures | Effect measure |
scale | Word | One of identity, log | The scale of the interval. Every ratio measure needs log, or its interval is symmetric and wrong |
value | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | Point estimate and interval as one value |
point | Number | The estimate, on the display scale | |
se | Number | At least 0 | Standard error on the analysis scale — of log(point) when scale: log |
lo | Number | Lower interval bound, display scale | |
hi | Number | Upper interval bound, display scale | |
level | Number | From 0 to 1 | Interval coverage as a fraction — 0.95, not 95 |
p | Number | From 0 to 1 | p-value. Exactly 0 is unattainable; write p < 0.001 in a string |
n | Number | Whole number, 0 or more | Participants contributing to the estimate |
events | Number | Whole number, 0 or more | Events in the subgroup |
df | Number | At least 1 | Degrees of freedom; when present the interval uses t, not z |
unit | Text | Unit of a difference measure — meaningless for a ratio | |
weight | Percent | 92% or 0.92 | Weight in a pooled analysis |
null_value | Number | Where no effect sits — 1 for a ratio, 0 for a difference | |
expr | Expression | Written = … | Expression deriving the estimate from other blocks |
of | Block id | The meta or estimate this subgroup belongs to | |
variable | Text | Variable defining the subgroups — age band, sex | |
category | Text | This subgroup's category of that variable — 65 and over | |
stratum | Text | Alias of category, for authors who think in strata | |
k | Number | Whole number, 0 or more | Studies in this subgroup |
p_interaction | Number | From 0 to 1 | Test for subgroup difference — the only honest basis for a subgroup claim |
prespecified | true/false | Declared before the data were seen. A post-hoc subgroup must say so | |
i2 | Percent | 92% or 0.92 | I-squared within the subgroup |
tau2 | Number | At least 0 | Between-study variance within the subgroup |
survival — Survival. A time-to-event curve — times, events, at-risk ticks per group, plus the hazard ratio. Takes an id. Typical children: group, series, estimate, effect, note, view. Read by the km view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Figure title | |
outcome | Block id | The event being timed | |
time_unit | Text | Unit of the time axis — months, days | |
times | List of numbers | Time points, ascending | |
at_risk | List of numbers | At-risk counts at each tick — the risk table row | |
events | List of numbers | Cumulative or interval events at each time | |
censored | List of numbers | Censored counts at each time | |
survival | List of numbers | Survival probability at each time (0–1) | |
group | Word | Group these rows describe, for a single-curve block | |
estimator | Word | One of kaplan_meier, nelson_aalen, aalen_johansen, cox, flemington_harrington, life_table | How the curve was estimated |
median | Quantity | A duration, such as 14 months | Median survival, with its time unit — 14 months |
median_lo | Quantity | A duration, such as 14 months | Lower bound of the median survival interval, with a time unit |
median_hi | Quantity | A duration, such as 14 months | Upper bound of the median survival interval, with a time unit |
follow_up | Quantity | A duration, such as 14 months | Median or maximum follow-up, with its time unit |
hr | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | Hazard ratio with its interval |
p_logrank | Number | From 0 to 1 | Log-rank test p-value |
risk_table | true/false | Draw the numbers-at-risk table beneath the axis | |
censor_marks | true/false | Tick every censoring event on the curve | |
confidence_band | true/false | Draw the confidence band | |
level | Number | From 0 to 1 | Coverage of the band as a fraction |
cumulative | true/false | Plot cumulative incidence rather than survival | |
competing_risks | true/false | A competing-risks analysis | |
proportional_hazards | true/false | Whether the PH assumption was checked and held |
roc — ROC curve. A receiver-operating-characteristic curve with its AUC, thresholds and validation provenance. Takes an id. Read by the roc view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Figure title | |
model | Word | Model or test being characterised | |
auc | Number | From 0 to 1 | Area under the curve — a proportion, so 0.84 not 84 |
auc_lo | Number | From 0 to 1 | Lower bound of the AUC interval |
auc_hi | Number | From 0 to 1 | Upper bound of the AUC interval |
value | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | AUC with its interval in one value |
fpr | List of numbers | False-positive rates, ascending (1 − specificity) | |
tpr | List of numbers | True-positive rates (sensitivity) at each fpr | |
thresholds | List of numbers | Decision thresholds matching each point | |
n | Number | Whole number, 0 or more | Participants |
events | Number | Whole number, 0 or more | Positive cases |
prevalence | Percent | 92% or 0.92 | Prevalence of the condition |
diagonal | true/false | Draw the chance line (default true) | |
partial_auc_from | Number | From 0 to 1 | Start of a partial-AUC range |
partial_auc_to | Number | From 0 to 1 | End of a partial-AUC range |
operating_point | Number | From 0 to 1 | Threshold the figure highlights |
validation | Word | One of the validation types | How the curve was validated. apparent means in-sample and should say so |
dataset | Block id | The dataset block this is bound to | |
level | Number | From 0 to 1 | Interval coverage as a fraction |
calibration — Calibration. Predicted-versus-observed risk with intercept, slope and Brier score — the other half of discrimination. Takes an id. Read by the calibration view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Figure title | |
model | Word | Model being calibrated | |
predicted | List of numbers | Mean predicted risk per bin (0–1) | |
observed | List of numbers | Observed proportion per bin (0–1) | |
bins | Number | Whole number, 1 or more | Number of risk groups — 10 for deciles |
intercept | Number | Calibration-in-the-large; 0 is perfect | |
slope | Number | Calibration slope; 1 is perfect, below 1 means overfitted | |
brier | Number | From 0 to 1 | Brier score — lower is better |
brier_scaled | Number | At most 1 | Scaled Brier score |
ici | Number | At least 0 | Integrated calibration index |
emax | Number | At least 0 | Maximum calibration error |
hl_p | Number | From 0 to 1 | Hosmer–Lemeshow p — a weak test; report the plot too |
method | Word | One of loess, spline, quantile, decile, isotonic, binned | How the calibration curve was smoothed or binned |
n | Number | Whole number, 0 or more | Participants |
events | Number | Whole number, 0 or more | Positive cases |
validation | Word | One of the validation types | How the predictions were validated |
dataset | Block id | The dataset block this is bound to | |
diagonal | true/false | Draw the line of perfect calibration | |
histogram | true/false | Show the distribution of predicted risk under the plot |
decision_curve — Decision curve. Net benefit across threshold probabilities, against treat-all and treat-none. Takes an id. Read by the decision_curve view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Figure title | |
model | Word | Strategy being evaluated | |
thresholds | List of numbers | Threshold probabilities (0–1), ascending | |
net_benefit | List of numbers | Net benefit at each threshold | |
treat_all | List of numbers | Net benefit of treating everyone | |
treat_none | List of numbers | Net benefit of treating nobody — usually zero | |
prevalence | Percent | 92% or 0.92 | Prevalence of the condition |
harm | Number | At least 0 | Harm of the test itself, in net-benefit units |
interventions_avoided | List of numbers | Interventions avoided at each threshold | |
n | Number | Whole number, 0 or more | Participants |
events | Number | Whole number, 0 or more | Positive cases |
smooth | true/false | Smooth the curve | |
dataset | Block id | The dataset block this is bound to | |
unit | Text | What net benefit is expressed per — per 100 patients | |
validation | Word | One of the validation types | Where the predicted risks were measured. apparent means in-sample, and its net benefit is optimistic |
diagnostic — Diagnostic 2×2. A diagnostic-accuracy 2×2 table and everything derived from it — sensitivity through likelihood ratios. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Title | |
index_test | Text | The test under evaluation | |
reference_standard | Text | What it is judged against | |
tp | Number | Whole number, 0 or more | True positives |
fp | Number | Whole number, 0 or more | False positives |
fn | Number | Whole number, 0 or more | False negatives |
tn | Number | Whole number, 0 or more | True negatives |
n | Number | Whole number, 0 or more | Total tested — should equal tp+fp+fn+tn |
sensitivity | Percent | 92% or 0.92 | Written either 92% or 0.92 |
specificity | Percent | 92% or 0.92 | Specificity, written 88% or 0.88 |
ppv | Percent | 92% or 0.92 | Positive predictive value — depends on prevalence |
npv | Percent | 92% or 0.92 | Negative predictive value |
accuracy | Percent | 92% or 0.92 | Overall accuracy |
prevalence | Percent | 92% or 0.92 | Prevalence in the tested population |
lr_positive | Number | At least 0 | Positive likelihood ratio |
lr_negative | Number | At least 0 | Negative likelihood ratio |
dor | Number | At least 0 | Diagnostic odds ratio |
youden | Number | From -1 to 1 | Youden's J |
threshold | Quantity | Cut-off the 2×2 was built at, with its unit | |
level | Number | From 0 to 1 | Interval coverage as a fraction |
indeterminate | Number | Whole number, 0 or more | Results that were neither positive nor negative |
blinded | true/false | Index test read without knowledge of the reference standard |
distribution — Distribution. Raw values for a box, violin, raincloud or histogram — plus the summary statistics they imply. Takes an id. Typical children: group, series, note. Read by the raincloud and table_one views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Figure title | |
label | Text | Label for this distribution | |
values | List of numbers | The raw observations — what a box or violin is drawn from | |
kind | Word | One of box, violin, raincloud, strip, beeswarm, histogram, density, dot, ecdf | How to draw it. box over n<10 hides the data; prefer strip or raincloud |
n | Number | Whole number, 0 or more | Number of observations |
mean | Number | Mean | |
sd | Number | At least 0 | Standard deviation |
se | Number | At least 0 | Standard error |
median | Number | Median | |
q1 | Number | First quartile | |
q3 | Number | Third quartile | |
iqr | Number | At least 0 | Interquartile range |
min | Number | Minimum | |
max | Number | Maximum | |
lo | Number | Lower whisker or interval bound | |
hi | Number | Upper bound | |
outliers | List of numbers | Values drawn as outliers | |
whisker | Word | One of tukey, minmax, sd, se, ci, iqr, percentile | What the whiskers mean. A box plot that does not say is unreadable |
bins | Number | Whole number, 1 or more | Number of histogram bins |
bandwidth | Number | At least 0 | Kernel bandwidth for a density or violin |
jitter | true/false | Offset overlapping points so n is visible | |
unit | Text | Unit of the values | |
group | Word | Group this distribution belongs to | |
of | Block id | The block this distribution belongs to | |
dataset | Block id | The dataset block this is bound to | |
column | Block id | The column these values are bound to | |
log | true/false | Values are already logged | |
digits | Number | Whole number, from 0 to 6 | Decimals for this row of a table_one, overriding the table's own digits |
series — Series. A named run of paired values with its error bars, encoding and redundant non-colour channel. Takes an id. Read by the roc, calibration, decision_curve, control_chart and table_one views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
label | Text | Series name, for the legend | |
x | List of numbers | X values, paired positionally with y | |
y | List of numbers | Y values, paired with x | |
values | List of numbers | Y values when x is implicit (index or category order) | |
labels | List of labels | Category labels, paired with values | |
lo | List of numbers | Lower error-bar bound per point | |
hi | List of numbers | Upper error-bar bound per point | |
se | List of numbers | Standard error per point | |
n | List of numbers | Per-point sample sizes | |
group | Word | Group this series belongs to | |
color | Text | Colour, hex or named | |
colour | Text | British spelling of color; either is accepted | |
marker | Word | One of circle, square, triangle, diamond, cross, plus, star, none | Point shape — the redundant channel that keeps a figure readable in greyscale |
dash | Word | One of solid, dashed, dotted, dashdot, none | Line style |
encoding | Word | One of line, bar, column, area, point, scatter, step, ribbon | How the series is drawn |
width | Number | At least 0 | Stroke width in points |
unit | Text | Unit of the values | |
x_unit | Text | Unit of x | |
y_unit | Text | Unit of y | |
axis | Block id | The axis this series is measured against | |
of | Block id | The block this series belongs to | |
dataset | Block id | The dataset block this is bound to | |
x_column | Block id | Column the x values are read from | |
y_column | Block id | Column the y values are read from | |
smooth | true/false | Smooth the line | |
stack | Word | Stack group; series sharing a name stack together |
group — Group. One group's raw values or survival row — the unit a box plot, violin or Kaplan–Meier curve repeats. Takes an id. Read by the km, raincloud and table_one views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
label | Text | Group name | |
values | List of numbers | Raw observations for this group | |
n | Number | Whole number, 0 or more | Number in the group |
mean | Number | Mean | |
sd | Number | At least 0 | Standard deviation |
se | Number | At least 0 | Standard error |
median | Number | Median | |
q1 | Number | First quartile | |
q3 | Number | Third quartile | |
lo | Number | Lower bound | |
hi | Number | Upper bound | |
events | List of numbers | For a survival curve: one code per subject, matching times (1 for an event, 0 for censored). With at_risk, the event count at each time instead | |
at_risk | List of numbers | Numbers at risk at each time. Giving it turns the group into a life table (useful when digitising a published curve) | |
censored | List of numbers | Censored counts at each time, in a life table | |
times | List of numbers | For a survival curve: one follow-up time per subject. With at_risk, the distinct times of the life table | |
survival | List of numbers | Survival probabilities, for a survival row | |
color | Text | Colour, hex or named | |
colour | Text | British spelling of color; either is accepted | |
unit | Text | Unit of the values | |
order | Number | Whole number | Position in the legend and on the axis |
from | Block id | Cohort or arm this group is drawn from | |
dataset | Block id | The dataset block this is bound to | |
column | Block id | The column these values are bound to | |
reference | true/false | This is the comparison baseline |
dose_response — Dose–response. Doses against responses with the fitted curve's parameters — EC50, Hill slope, plateaux. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Figure title | |
doses | List of numbers | Doses, ascending, in dose_unit | |
responses | List of numbers | Mean response at each dose | |
lo | List of numbers | Lower bound at each dose | |
hi | List of numbers | Upper bound at each dose | |
n | List of numbers | Replicates per dose | |
dose_unit | Text | Unit of the dose axis — mg/kg, µM, Gy | |
response_unit | Text | Unit of the response axis | |
model | Word | One of four_param, three_param, five_param, log_logistic, emax, linear, log_linear, sigmoid, weibull, hill | The fitted curve |
ec50 | Quantity | Half-maximal effective concentration, with its unit | |
ic50 | Quantity | Half-maximal inhibitory concentration, with its unit | |
ed50 | Quantity | Half-maximal effective dose, with its unit | |
hill | Number | Hill slope | |
top | Number | Upper plateau | |
bottom | Number | Lower plateau | |
r2 | Number | At most 1 | Goodness of fit |
log_dose | true/false | Doses are already log-transformed | |
p_trend | Number | From 0 to 1 | Test for a monotone trend across doses |
dataset | Block id | The dataset block this is bound to |
power — Power. A power calculation: the effect assumed, the test, and the design that follows from them. Takes an id. Read by the experiment_flow view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Title | |
power | Percent | 92% or 0.92 | Statistical power — written either 80% or 0.8 |
alpha | Number | From 0 to 1 | Type-I error rate, as a fraction |
sides | Number | Whole number from 1 to 2 | 1 or 2 — a one-sided test must justify itself |
effect_size | Number | The effect the calculation assumes | |
measure | Word | One of the effect measures | Effect measure the calculation uses |
sd | Number | At least 0 | Assumed standard deviation |
n | Number | Whole number, 1 or more | Total sample size |
n_per_group | Number | Whole number, 1 or more | Sample size per group |
allocation | Number | At least 0 | Allocation ratio, e.g. 2 for 2:1 |
test | Word | One of t, z, chi2, fisher, log_rank, anova, proportion, correlation, regression, mcnemar, simulation | The test the calculation assumes |
baseline_rate | Percent | 92% or 0.92 | Assumed control-arm event rate |
target_rate | Percent | 92% or 0.92 | Assumed event rate in the intervention arm |
events_required | Number | Whole number, 1 or more | Events, not participants — what a survival trial is powered on |
dropout | Percent | 92% or 0.92 | Assumed dropout |
icc | Number | From 0 to 1 | Intra-cluster correlation, for a cluster design |
clusters | Number | Whole number, 1 or more | Number of clusters, for a cluster design |
cluster_size | Number | Whole number, 1 or more | Participants per cluster |
design_effect | Number | At least 1 | Design effect for clustering |
margin | Quantity | Non-inferiority or equivalence margin, with its unit | |
hypothesis | Word | One of superiority, non_inferiority, equivalence, futility, estimation | What the trial sets out to show |
achieved | true/false | This is post-hoc achieved power, not the a-priori target | |
software | Text | What computed it — a power claim needs to be reproducible |
sample_size — Sample size. The planned and achieved sample size, and the assumption the plan rested on. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Title | |
target | Number | Whole number, 1 or more | Planned total sample size |
per_group | Number | Whole number, 1 or more | Planned size per group |
achieved | Number | Whole number, 0 or more | Actually recruited |
analysed | Number | Whole number, 0 or more | Included in the analysis set |
groups | Number | Whole number, 1 or more | Number of groups |
power | Percent | 92% or 0.92 | Power the target was calculated for |
alpha | Number | From 0 to 1 | Significance level |
dropout | Percent | 92% or 0.92 | Attrition the target was inflated for |
inflation | Number | At least 1 | Multiplier applied for dropout or clustering |
margin | Quantity | Non-inferiority or equivalence margin, with its unit | |
method | Text | How it was calculated | |
assumption | Text | The assumption the number rests on, in words | |
of | Block id | The power block or study this sizes | |
interim | true/false | An interim or adaptive re-estimation | |
stopping_rule | Text | The stopping rule, in words |
table_one — Baseline table. The baseline-characteristics table — groups, variables, and how each row is summarised. Takes an id. Typical children: group, distribution, note, view. Read by the table_one view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Table title | |
groups | List of labels | Column headings — the arms or cohorts compared | |
variables | List of labels | Row headings, in the order they should print | |
n | Number | Whole number, 0 or more | Total participants |
overall | true/false | Include an all-participants column | |
p_values | true/false | Print per-row p-values. CONSORT advises against them for baseline tables | |
smd | true/false | Print standardised mean differences instead of p-values | |
missing | Percent | 92% or 0.92 | Overall missingness across the table |
continuous_summary | Word | One of mean_sd, median_iqr, median_range, mean_ci, geometric_mean | How continuous rows are summarised — and it must be stated |
categorical_summary | Word | One of n_percent, percent, n | How categorical rows are summarised |
digits | Number | Whole number from 0 to 6 | Decimal places printed |
dataset | Block id | The dataset block this is bound to | |
footnote | Text | Footnote under the table |
control_chart — Control or run chart. A statistical-process-control or run chart's own parameters — baseline, centre line, limits, when the intervention started, and the rules it is read against. Takes an id. Read by the control_chart view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
metric | Text | The measure this chart plots, with its unit and its period | |
chart | Text | Chart type as the team names it — run chart, p chart, u chart, xbar-s | |
baseline_period | Text | The dates the pre-intervention baseline covers. Every improvement claim is a comparison against it | |
baseline_n | Number | Whole number, 0 or more | How many observations the baseline is built from |
centre_line | Text | The centre line the points are judged against, how it was calculated, and when it was re-based | |
limits | Text | The control limits, or a statement that this is a run chart and none are drawn | |
intervention_at | Text | When each intervention or PDSA cycle started, as a point on the time axis. Without it nothing marks the change the chart exists to show | |
rules | List of labels | The special-cause rules applied, named — a shift, a trend, a point beyond the limits. This is what says out loud what would have counted as a signal rather than noise | |
special_cause | Text | The special-cause variation actually found, and where on the chart | |
annotations | Text | Other events marked on the chart — a scanner replacement, industrial action |
Evidence appraisal and reporting
Risk of bias, GRADE, reporting standards, and the narrative "reporting homes" the checklists on the Reporting standards page read and write.
bias_domain — Bias domain. One domain of a risk-of-bias tool — RoB 2, ROBINS-I, QUADAS-2 — as a declared column. Takes an id. Read by the rob_traffic_light and rob_summary_bar views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | Domain as the tool names it — Randomisation process | |
tool | Word | One of the appraisal tools | The appraisal tool this domain belongs to |
label | Text | Short heading for the traffic-light column | |
order | Number | Whole number, 1 or more | Column order in the summary plot |
signalling_questions | List of labels | The tool's questions for this domain | |
description | Text | What the domain covers | |
applies_to | Word | One of randomised, non_randomised, diagnostic, prognostic, review, any | Which study designs the domain applies to |
bias_assessment — Bias assessment. One study × domain risk-of-bias judgement with its supporting quotation and predicted direction. Takes an id. Read by the rob_traffic_light and rob_summary_bar views.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
study | Block id | The study (or estimate) being judged | |
domain | Block id | The bias_domain this judgement is for | |
tool | Word | One of the appraisal tools | The appraisal tool used |
judgement | Word | One of the risk-of-bias judgements | Judgement |
overall | Word | One of the risk-of-bias judgements | Overall judgement across domains |
outcome | Block id | RoB 2 is per-outcome; name the outcome judged | |
support | Text | Quotation from the paper supporting the judgement | |
rationale | Text | Why the assessor landed there | |
assessor | Text | Who made the judgement | |
second_assessor | Text | Duplicate assessment — a reporting requirement | |
consensus | true/false | Disagreements were resolved by consensus or arbitration | |
date | Text | When | |
direction | Word | One of favours_experimental, favours_comparator, towards_null, away_from_null, unpredictable, none | Predicted direction of the bias — ROBINS-I asks for this and figures rarely show it |
grade_outcome — GRADE outcome. A GRADE certainty rating with each domain's downgrade and the footnote reasons behind it. Takes an id. Read by the grade_sof view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
outcome | Block id | The outcome being rated | |
estimate | Block id | The estimate or meta the rating is about | |
certainty | Word | One of high, moderate, low, very_low | Certainty of evidence |
starting_certainty | Word | One of high, moderate, low, very_low | Before downgrades — high for RCTs, low for observational |
risk_of_bias | Word | One of not_serious, serious, very_serious | Downgrade for risk of bias |
inconsistency | Word | One of not_serious, serious, very_serious | Downgrade for inconsistency |
indirectness | Word | One of not_serious, serious, very_serious | Downgrade for indirectness |
imprecision | Word | One of not_serious, serious, very_serious | Downgrade for imprecision |
publication_bias | Word | One of undetected, suspected, strongly_suspected | Assessment of publication bias |
large_effect | Word | One of none, large, very_large | Upgrade for magnitude |
dose_response | true/false | Upgrade for a dose–response gradient | |
residual_confounding | true/false | Upgrade: plausible confounding would reduce the effect | |
downgrades | List of labels | Reasons, in the words a Summary of Findings footnote needs | |
upgrades | List of labels | Reasons for any upgrade | |
importance | Word | One of critical, important, not_important | Importance to decision-makers, decided before the results were seen |
studies | Number | Whole number, 0 or more | Number of studies |
participants | Number | Whole number, 0 or more | Number of participants |
design | Text | Design of the included studies | |
reason | Text | One-line summary of the rating |
sof_row — Summary-of-findings row. One row of a GRADE Summary of Findings table — absolute risks, relative effect, certainty. Takes an id. Read by the grade_sof view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
outcome | Block id | The outcome this row reports | |
label | Text | Row label when the outcome has no metric | |
estimate | Block id | The relative effect this row reports | |
grade | Block id | The grade_outcome supplying the certainty | |
certainty | Word | One of high, moderate, low, very_low | Certainty of the evidence |
relative_effect | Text | As printed — RR 0.68 (0.51 to 0.90) | |
risk_control | Quantity | A proportion or rate, such as 128 per 1000 or 12.8% | Absolute risk without the intervention — 128 per 1000 |
comparator_risk_basis | Text | Where risk_control came from: the control arms, a registry, or a stated assumption | |
risk_intervention | Quantity | A proportion or rate, such as 128 per 1000 or 12.8% | Absolute risk with it |
risk_difference | Quantity | A proportion or rate, such as 128 per 1000 or 12.8% | Difference, with its interval in comments if needed |
participants | Number | Whole number, 0 or more | Participants |
studies | Number | Whole number, 0 or more | Studies |
follow_up | Quantity | A duration, such as 14 months | Follow-up the risks apply to — 2 years |
comments | Text | The footnote column — where a downgrade is explained | |
importance | Word | One of critical, important, not_important | Importance of the outcome |
order | Number | Whole number, 1 or more | Row order in the table |
guideline — Reporting guideline. Which reporting standard this figure claims to follow, at which version, and where the checklist is. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
standard | Word | One of the reporting standards | Which reporting standard this figure claims |
label | Text | Display name — CONSORT | |
version | Text | Version as published — 2010. Never invent one | |
year | Number | Whole number from 1980 to 2100 | Year the standard was published |
extension | Text | Named extension — cluster trials, harms, abstracts | |
scope | Text | What kind of study the checklist is for | |
reference | Text | Citation for the checklist itself | |
url | Text | Where the standard is published | |
claimed | true/false | The author asserts compliance, rather than merely scoring against it | |
checklist | Text | Path or URL of the completed checklist accompanying the submission | |
completeness | Percent | 92% or 0.92 | A completeness score, if you recorded one |
of | Block id | The view or figure the claim is about |
animal_study — Animal-study report. The statements an animal-research report has to make and a figure has no number for — experimental unit, randomisation, blinding, housing, welfare, ethics. Takes an id. Read by the experiment_flow view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
abstract | Text | The abstract, or a note of where it is | |
background | Text | The scientific background, including why this species and this model were chosen | |
objective | Text | The objective, or the hypothesis being tested | |
experimental_unit | Text | What was independently allocated — a single animal, a cage, a litter, a tank. The number the analysis is allowed to treat as n | |
inclusion_criteria | Text | The criteria for including or excluding an animal or a data point, and whether they were set in advance | |
randomisation | Text | Whether allocation was randomised and, if so, how the sequence was generated | |
confounders | Text | How treatment order, time of day and cage position were handled — or a statement that they were not controlled | |
blinding | Text | Who knew the allocation at allocation, during the work, at outcome assessment and at analysis. All four stages: the ARRIVE check names the stages a statement leaves out | |
procedures | Text | When and how often the procedures were performed, where, and why this model, route and dose | |
statistical_methods | Text | The statistical methods for each analysis, where outcome.test does not carry them | |
assumptions | Text | How the assumptions of the analysis were checked, and what was done when they failed | |
software | Text | The software that ran the analyses, where a power block does not name it | |
ethical_statement | Text | The ethical review body, the licence number, and the guidelines the work followed | |
housing | Text | Cage type and group size, light cycle, temperature, diet and enrichment | |
animal_care | Text | Analgesia and anaesthesia, the monitoring schedule, the humane endpoints, and how many animals reached them | |
interpretation | Text | How the results sit against the existing literature, with the limitations and possible biases | |
generalisability | Text | How far the findings should be expected to transfer to other species or strains, or to humans | |
registration | Text | Where and when the protocol was registered and its number, or that it was not registered | |
data_access | Text | Where the data can be obtained and on what terms, where dataset.availability does not say | |
funding | Text | Who paid for the work and what part they played, where no funding block carries it | |
declaration_of_interests | Text | Competing interests, or a statement that there are none — one is asked for either way |
qi_project — Quality-improvement project. A quality-improvement report — the local problem, the rationale, the aim, the context, the intervention, and how attribution was studied. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
abstract | Text | The structured abstract | |
problem | Text | The nature and significance of the local problem | |
available_knowledge | Text | What is already known about the problem | |
rationale | Text | The reasoning or theory of change that led to this intervention | |
aim | Text | The specific aim of the project, with its target and its deadline | |
context | Text | The contextual elements that matter to the result | |
intervention | Text | The intervention in enough detail to reproduce it, and who the team was | |
study_of_intervention | Text | How the intervention's impact was assessed, and how the observed change was attributed to it rather than to time | |
measure_validity | Text | Why these measures, and what is known about their validity and reliability | |
analysis_methods | Text | The qualitative and quantitative methods used to draw inferences | |
ethical_considerations | Text | Ethical aspects, how they were addressed, and any conflict of interest | |
missing_data | Text | What data were missing or incomplete. A chart with silent gaps overstates its own stability | |
summary | Text | The key findings and the project's particular strengths | |
interpretation | Text | How the intervention relates to the outcomes, how it compares with other reports, and the costs and opportunity costs | |
limitations | Text | Limits to generalisability, limits to internal validity, and what was done to reduce them | |
conclusions | Text | Usefulness, sustainability, potential for spread, and the next steps | |
funding | Text | Who paid for the work and what part they played, where no funding block carries it |
qual_study — Qualitative-study report. The reporting home COREQ and SRQR share — the research team and its reflexivity, the sampling, the interview conduct, saturation, coding and trustworthiness. Takes an id. Read by the theme_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
interviewer | Text | Who conducted the interview or focus group | |
researcher_credentials | Text | The researchers' credentials | |
researcher_occupation | Text | Their occupation at the time of the study | |
researcher_gender | Text | The gender of the researchers who collected the data | |
researcher_experience | Text | Their experience and training in qualitative research | |
relationship_established | Text | Whether a relationship with participants existed before the study began | |
participant_knowledge | Text | What the participants knew about the researcher | |
interviewer_characteristics | Text | Characteristics of the interviewer that may have influenced the interviews | |
reflexivity | Text | The researchers' own influence on the research, and how it was addressed | |
methodology | Text | The methodological orientation and the theory underpinning the study | |
paradigm | Text | The paradigm or approach the study works within | |
sampling | Text | How the participants were selected, and on what dimensions the sample was varied | |
method_of_approach | Text | How the participants were first approached | |
repeat_interviews | Text | Whether interviews were repeated, and why | |
sample_description | Text | The sample's characteristics | |
participant_characteristics | Text | Fuller participant characteristics, where they do not fit sample_description | |
data_collection_setting | Text | Where the data were collected | |
others_present | Text | Anyone present besides the participant and the researcher | |
context | Text | The setting and context of the study | |
instruments | Text | The questions, prompts and guides, where an instrument block with item children does not carry them | |
pilot_tested | Text | Whether the topic guide was pilot tested, and what changed as a result | |
recording | Text | Whether audio or visual recording was used | |
field_notes | Text | Whether field notes were made, and when | |
interview_duration | Text | How long the interviews or focus groups lasted | |
saturation | Text | Whether data saturation was discussed, and how it was judged | |
transcripts_returned | Text | Whether transcripts were returned to participants for comment | |
data_collection | Text | The data-collection methods and the procedures behind them | |
data_processing | Text | Transcription and data preparation before analysis | |
coders | Text | How many people coded the data, and who they were | |
theme_derivation | Text | Whether the themes were derived in advance or from the data | |
software | Text | The software used to manage and code the data | |
member_checking | Text | Whether the participants gave feedback on the findings | |
trustworthiness | Text | The techniques used to establish trustworthiness and credibility | |
problem | Text | The problem formulation, and why it matters | |
research_question | Text | The research question, or the purpose of the study | |
objective | Text | The study objective, where it is narrower than the research question | |
abstract | Text | The abstract, or a note of where in the manuscript it is | |
discussion | Text | How the findings integrate with prior work | |
implications | Text | The implications of the findings | |
transferability | Text | How far the findings transfer beyond this setting | |
limitations | Text | The study's limitations | |
ethics | Text | Ethical approval and the body that granted it | |
consent | Text | The consent process, including consent to be quoted | |
funding | Text | Who paid for the work and what part they played, where no funding block carries it | |
declaration_of_interests | Text | Competing interests, including when there are none |
tidier_intervention — Intervention description (TIDieR). One intervention described so another team could deliver it — what, why, by whom, how, where, when, how much, and how faithfully. Takes an id. Read by the intervention_table view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
brief_name | Text | The name or phrase that describes the intervention | |
why | Text | The rationale, theory or goal essential to the intervention | |
materials | Text | The physical or informational materials used, and where a reader can obtain them | |
procedures | Text | Each procedure, activity and process, including any enabling or supporting activity | |
provider | Text | Who delivered it, their expertise, and any training they were given for it | |
mode | Text | How it was delivered — face to face, by telephone, individually or in a group | |
location | Text | Where it took place, including any infrastructure the site needed | |
schedule | Text | When and how much — the number of sessions, the schedule, the duration, the dose or intensity | |
tailoring | Text | Whether the intervention was personalised or adapted, and how | |
modifications | Text | Any modification made during the study, and why | |
fidelity_planned | Text | How adherence and fidelity were planned to be assessed | |
fidelity_actual | Text | The fidelity actually achieved, and any deviation from what was planned |
appraisal — Appraisal protocol. What a risk-of-bias appraisal states once rather than per study — which tool at which version, who assessed, and how disagreements were settled. Takes an id. Read by the appraisal_table view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
tool | Word | One of the appraisal tools | The appraisal tool, from the same list bias_domain and bias_assessment use, so one document names the tool one way |
version | Text | The version of the tool as published on it — the RoB 2 template dated 22 August 2019 | |
effect_of_interest | Text | Which effect the assessment is about: assignment to the intervention, or adherence to it. The two use different signalling questions and can give different judgements | |
unit_of_assessment | Text | What was appraised — a study, a single result, a study × outcome pair | |
assessors | List of labels | Who appraised. A list or a single name both read the same | |
duplicate | true/false | Each result was appraised independently by two assessors | |
disagreements | Text | How disagreements between assessors were settled. The one statement a duplicated appraisal is incomplete without | |
target_trial | Text | The hypothetical randomised trial a non-randomised comparison is judged against | |
confounders | Text | The confounding domains listed before the assessment began. Per-domain status belongs on confounder blocks | |
tailoring | Text | Any modification made to the published tool, and why | |
review_question | Text | The review question the appraisal is judged against | |
relevance | Text | Whether the review matches the target question, and where it does not | |
confidence | Text | The overall confidence in the results of the review, as the tool words it |
signalling — Signalling answers. One assessment's recorded answers to its tool's signalling questions — what turns an asserted judgement into a re-runnable one. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
of | Block id | The bias_assessment these answers belong to. Pointing at nothing used to be silent, and every domain then fell back to cannot tell | |
answers | Object | The answers keyed by the tool's own question ids — answers { q1_1: "Y", q1_2: "PN", q1_3: "NI" } |
applicability — Applicability concern. A per-study, per-domain judgement of concern about applicability — a different question from risk of bias, asked of the same pair. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
study | Block id | The study this applicability judgement is about | |
domain | Block id | The bias_domain it is about — the applicability question is asked of the same domains as the risk question | |
judgement | Word | One of the risk-of-bias judgements | Level of concern about applicability, from the same list a risk judgement uses |
rationale | Text | Why the assessor landed there |
confounder — Confounding domain. One confounding domain a non-randomised comparison was appraised against, and whether it was pre-specified, measured and controlled for. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | The confounding domain as the appraisal names it — calendar time, baseline severity | |
prespecified | true/false | This domain was on the list before the papers were read. Judging against a list assembled afterwards is how a study with no adjustment at all gets rated moderate | |
measured | true/false | The study measured this domain | |
controlled | true/false | The study's analysis controlled for it | |
method | Text | How it was controlled for — adjustment, matching, stratification, restriction |
amstar_item — AMSTAR 2 item. One answered item of an AMSTAR 2 appraisal form — the item number, the answer, and the note behind it. Takes an id. Read by the appraisal_table view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
number | Text | The item number as the form prints it — 1 through 16. A string, because some items are lettered | |
answer | Word | One of yes, y, partial_yes, partial, py, no, n, not_applicable, na, no_meta_analysis | The answer to this item. The short spellings y, py, n and na are also read |
note | Text | The reasoning, or the quotation from the review, behind the answer |
Health economics
Cost-effectiveness models, strategies, ICERs and probabilistic sensitivity analyses.
econ_model — Cost-effectiveness model. The frame of a cost-effectiveness analysis: perspective, currency, time horizon and discount rate. Takes an id. Typical children: intervention, view, note. Read by the ce_plane view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
perspective | Text | payer, societal, health-system | |
currency | Text | ISO 4217 currency code | |
horizon | Text | Time horizon, such as lifetime, 10y or 1y | |
discount | Number | Annual discount rate (e.g. 0.035) | |
title | Text | Model title |
intervention — Intervention. One intervention's per-patient cost and QALYs, and what it is compared with. Takes an id. Read by the ce_plane view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | Required | Intervention name |
cost | Number | Required | Per-patient total cost over horizon |
qalys | Number | Required | Per-patient QALYs gained |
comparator | Block id | Intervention this is compared against | |
arm | Text | treatment, control, standard-of-care |
economic_strategy — Economic strategy. One strategy on the cost-effectiveness plane, with its costs, effects and frontier status. Takes an id. Read by the ce_plane view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | Strategy name | |
cost | Quantity | Per-patient cost over the horizon, with its currency unit | |
qalys | Number | Per-patient QALYs | |
effect | Number | Per-patient effect when the outcome is not a QALY | |
effect_unit | Text | Unit of effect — life-years, cases averted | |
comparator | Block id | Strategy this is compared against | |
dominated | true/false | More costly and less effective than an alternative | |
extendedly_dominated | true/false | Ruled out by the frontier despite not being dominated | |
on_frontier | true/false | On the cost-effectiveness frontier | |
currency | Text | ISO 4217 — USD, EUR, GBP, NGN… | |
price_year | Number | Whole number from 1900 to 2100 | Year the prices are in |
discount_costs | Percent | 92% or 0.92 | Annual discount rate applied to costs |
discount_effects | Percent | 92% or 0.92 | Annual discount rate applied to effects |
horizon | Text | lifetime, 10y, 1y | |
perspective | Word | One of payer, societal, health_system, provider, patient | Perspective of the costs |
arm | Word | One of treatment, control, standard_of_care, comparator, no_treatment | Which arm this strategy is |
of | Block id | The econ_model this belongs to |
icer — ICER. An incremental cost-effectiveness ratio with the threshold and verdict that make it mean something. Takes an id. Read by the ce_plane view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
of | Block id | Strategy the ratio is for | |
versus | Block id | Strategy it is compared against | |
incremental_cost | Quantity | Difference in cost, with its currency | |
incremental_qalys | Number | Difference in QALYs | |
incremental_effect | Number | Difference in effect, when the outcome is not a QALY | |
ratio | Number | Cost per unit of effect. Negative ratios are uninterpretable — say dominant or dominated instead | |
value | Estimate | Takes an interval, such as 0.68 [0.51, 0.90] | The ratio with its interval |
threshold | Quantity | Willingness-to-pay threshold the verdict is against | |
inmb | Quantity | Incremental net monetary benefit at that threshold | |
inhb | Number | Incremental net health benefit, in effect units | |
per | Text | What the cost is per — QALY gained | |
currency | Text | Currency | |
verdict | Word | One of cost_effective, not_cost_effective, dominant, dominated, extendedly_dominated, uncertain | The conclusion at the threshold |
interpretation | Text | The conclusion, in words | |
level | Number | From 0 to 1 | Interval coverage as a fraction |
psa — Probabilistic sensitivity analysis. A probabilistic sensitivity analysis — draws, seed, and the acceptability curve they produce. Takes an id. Read by the ce_plane view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Title | |
iterations | Number | Whole number, 1 or more | Monte-Carlo draws |
seed | Number | Whole number | Seed used — without it the cloud is not reproducible |
of | Block id | Strategy or icer the analysis is about | |
threshold | Quantity | Willingness-to-pay threshold, with its currency | |
ce_probability | Percent | 92% or 0.92 | Probability the strategy is cost-effective at that threshold |
parameter | Text | Parameter being varied, for a one-way row | |
distribution | Word | One of normal, lognormal, beta, gamma, dirichlet, uniform, triangular, bootstrap, empirical | Distribution a parameter was drawn from |
mean | Number | Mean of the parameter | |
sd | Number | At least 0 | Standard deviation of the parameter |
lo | Number | Lower bound of the parameter range | |
hi | Number | Upper bound of the parameter range | |
correlated | true/false | Parameters were sampled as correlated | |
ceac | List of numbers | Acceptability curve values across thresholds | |
thresholds | List of numbers | Thresholds the acceptability curve is evaluated at | |
evpi | Quantity | Expected value of perfect information | |
currency | Text | Currency, as an ISO 4217 code such as USD, EUR or GBP | |
software | Text | Software that produced it |
econ_report — Economic-evaluation report. The narrative half of an economic evaluation — population, setting, how outcomes were valued, model structure, discounting, equity, engagement. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
abstract | Text | The structured abstract | |
background | Text | The background to the evaluation and its practical relevance | |
objective | Text | The objective of the evaluation, and the question it answers | |
analysis_plan | Text | The health-economic analysis plan, and where it can be read | |
population | Text | The population the evaluation is about, and who was excluded | |
setting | Text | Setting, location and jurisdiction — the decision context this result belongs to. Costs and practice patterns do not travel | |
comparator_rationale | Text | Why these comparators, and what was ruled out | |
outcome_selection | Text | Which outcomes the evaluation is built on, and why those | |
outcome_measurement | Text | How the health outcomes were measured | |
outcome_valuation | Text | Where the utility weights came from, and whose preferences they are | |
cost_measurement | Text | How resource use was identified, measured and valued | |
currency | Text | The currency statement in prose, where the typed currency on econ_model or economic_strategy does not carry the whole story | |
discounting | Text | The discount rates applied to costs and to outcomes, and the reference case they come from — including a reasoned statement that none were applied | |
model_structure | Text | The model's structure, and why that structure | |
analytic_methods | Text | The analytic methods, and the assumptions behind them | |
structural_uncertainty | Text | The scenario analyses that address structural uncertainty — the uncertainty a probabilistic analysis cannot reach, because it varies parameters and not the model | |
heterogeneity | Text | How differences between subgroups were handled, where subgroup blocks do not carry them | |
distributional_effects | Text | Distributional effects and equity considerations | |
engagement | Text | How patients, the public and other stakeholders were involved | |
engagement_effect | Text | What that involvement changed about the evaluation | |
discussion | Text | The findings, their limitations, their generalisability, and how they fit current knowledge | |
funding | Text | Who paid for the work and what part they played, where no funding block carries it | |
declaration_of_interests | Text | Competing interests, including when there are none |
Data binding
Columns of a bound dataset. With rows bound on the Data bench, a column name the data does not have is an error (see The Data and Statistics benches).
column — Data column. One column of a bound dataset — its type, unit, role in the figure, and how it was derived. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
of | Block id | The dataset this column lives in | |
name | Text | Column name as it appears in the file | |
type | Word | One of number, integer, string, boolean, date, datetime, category, duration | Data type of the column |
unit | Text | Unit every value in the column carries | |
role | Word | One of value, group, time, event, weight, id, covariate, x, y, se, lo, hi, label, strata | What the figure uses the column for, such as an axis, a group or an event |
rows | Number | Whole number, 0 or more | Number of rows |
missing | Percent | 92% or 0.92 | Share of rows with no value |
levels | List of labels | Category levels, in the order they should be drawn | |
values | List of numbers | The column inline, for a figure small enough to carry its data | |
min | Number | Smallest value | |
max | Number | Largest value | |
mean | Number | Mean value | |
sd | Number | At least 0 | Standard deviation |
transform | Word | One of none, log, log10, log2, logit, sqrt, z_score, rank, standardise | Transform applied to the values |
description | Text | What the column holds | |
derived | Expression | Written = … | Expression computing this column from others |
Figure presentation
How a figure is drawn and described: axes, scales, palettes, captions, legends and alt text.
axis — Axis. One axis — its scale, domain, ticks, and whether it includes zero. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
of | Block id | The view or panel this axis belongs to | |
side | Word | One of left, right, top, bottom | Which side the axis is on |
label | Text | Axis label. A unit belongs here or in unit, never nowhere | |
unit | Text | Unit of the axis | |
scale | Word | One of the scale types | Scale type |
min | Number | Domain lower bound | |
max | Number | Domain upper bound | |
base | Number | At least 1 | Log base (default 10) |
exponent | Number | Exponent for a power scale | |
threshold | Number | At least 0 | Linear-region width for a symlog scale |
ticks | Number | Whole number, 0 or more | Target tick count |
tick_values | List of numbers | Exact ticks, when the automatic ones are wrong | |
tick_labels | List of labels | Labels for tick_values | |
tick_format | Text | Number format for tick labels | |
tick_rotation | Number | From -90 to 90 | Tick-label rotation in degrees |
zero | true/false | Include zero in the domain. A truncated bar axis misleads; say so deliberately | |
nice | true/false | Round the domain out to tick boundaries | |
grid | true/false | Draw grid lines | |
reverse | true/false | Reverse the axis direction | |
padding | Number | From 0 to 0.5 | Band padding as a fraction of the step |
break | true/false | The axis is broken — which must be marked on the figure itself | |
null_line | Number | Where the line of no effect is drawn — 1 on a log ratio axis | |
title | Text | Axis title |
scale — Scale. A named value-to-position or value-to-colour mapping, reusable across panels. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
type | Word | One of the scale types | Scale type |
of | Block id | The view or panel the scale belongs to | |
domain | List of numbers | Input range — [0, 100] | |
categories | List of labels | Ordinal domain, for a band or point scale | |
range | List of numbers | Output range in figure units | |
palette | Word | Palette id, or the id of a palette block, for a colour scale | |
clamp | true/false | Clamp values to the range | |
base | Number | At least 1 | Log base |
exponent | Number | Exponent for a power scale | |
threshold | Number | At least 0 | Linear-region width for a symlog scale |
center | Number | Midpoint of a diverging scale — 0 for a difference, 1 for a ratio | |
bins | Number | Whole number, 1 or more | Number of bins |
thresholds | List of numbers | Explicit bin thresholds | |
nice | true/false | Round the domain out to tick boundaries | |
reverse | true/false | Reverse the scale | |
padding | Number | From 0 to 0.5 | Band padding as a fraction of the step |
unit | Text | Unit of the scale | |
label | Text | Label for the scale |
palette — Palette. The colour set a figure uses, and the redundant channel that keeps it readable without colour. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Word | One of the built-in palettes | A built-in palette |
kind | Word | One of qualitative, sequential, diverging | qualitative, sequential, diverging |
colors | List of labels | Explicit hex colours, overriding name | |
colours | List of labels | British spelling of colors; either is accepted | |
n | Number | Whole number from 1 to 24 | How many colours are needed |
reverse | true/false | Reverse the colour order | |
for | Word | What the palette is applied to — a series, a group, a scale | |
center | Number | Data value the neutral midpoint sits at | |
redundant | Word | One of shape, dash, hatch, label, position, size, none | The non-colour channel carrying the same distinction — what makes the figure survive colourblindness and a greyscale printer |
cvd_safe | true/false | Asserted safe under protanopia/deuteranopia/tritanopia | |
greyscale_safe | true/false | Asserted to stay distinguishable in greyscale | |
source | Text | Where the colours come from, if they are not a built-in |
caption — Caption. The figure caption — including the error-bar and sample-size statements a journal requires. The id is optional.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
text | Text | The caption a journal will typeset | |
of | Block id | The view, panel or figure being captioned | |
title | Text | Bold lead sentence, where the house style wants one | |
number | Text | Figure number as printed — 1, S3 | |
panel | Word | Panel letter, for a per-panel caption | |
lead | Text | Lead sentence | |
abbreviations | Text | Expansions a caption is required to carry | |
statistics | Text | What the error bars and asterisks mean — the commonest caption omission | |
n_statement | Text | What n is and what it counts | |
source | Text | Data source or credit line | |
style | Word | One of journal, plain, structured | Caption style |
legend — Legend. The figure key — or the decision to label the marks directly instead. The id is optional.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
of | Block id | The view or panel the legend belongs to | |
title | Text | Legend title | |
position | Word | One of top, bottom, left, right, inside, none | Where the legend goes |
orientation | Word | One of horizontal, vertical | Legend direction |
items | List of labels | Entries, in the order they should read | |
symbol | Word | One of swatch, line, marker, patch, gradient | What each legend entry shows |
columns | Number | Whole number, 1 or more | Number of legend columns |
show | true/false | Set false when the series are labelled directly — usually the better figure | |
palette | Word | Palette the legend uses | |
direct_labels | true/false | Label the marks themselves instead of drawing a key |
alt — Alt text. The alternative text a screen reader reads and most journals now require. The id is optional.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
text | Text | Short alternative text — what the figure shows, not that it is a figure | |
of | Block id | The view, panel or figure the text describes | |
long | Text | Long description for a figure a sentence cannot carry | |
summary | Text | The finding in one sentence | |
trend | Text | Direction and magnitude, for a chart | |
lang | Text | BCP 47 language tag, when it is not the document's | |
decorative | true/false | Genuinely conveys nothing — rare, and almost never true of a data figure |
Attribution
Who wrote the figure, what it cites, who paid for it and how it may be reused.
cite — Citation. A reference the figure depends on — the paper, dataset or software behind a number. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
key | Text | Citation key — smith2020 | |
title | Text | Title of the work | |
authors | Text | Author list as it should print | |
journal | Text | Journal | |
year | Number | Whole number from 1400 to 2200 | Year |
volume | Text | Volume | |
issue | Text | Issue | |
pages | Text | Pages | |
doi | Text | DOI | |
pmid | Text | PubMed id | |
url | Text | Web address | |
publisher | Text | Publisher | |
accessed | Text | Date accessed | |
type | Word | One of article, preprint, book, chapter, dataset, software, report, thesis, webpage, guideline | Kind of work |
of | Block id | What this citation supports | |
note | Text | A note on the citation |
author — Author. One author of the figure, with their ORCID and CRediT role. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | Name as it should print | |
orcid | Text | ORCID iD | |
affiliation | Text | Affiliation | |
email | Text | ||
corresponding | true/false | Corresponding author | |
order | Number | Whole number, 1 or more | Position in the byline |
equal_contribution | true/false | Contributed equally | |
role | Word | One of conceptualization, data_curation, formal_analysis, funding_acquisition, investigation, methodology, project_administration, resources, software, supervision, validation, visualization, writing_original_draft, writing_review_editing | CRediT taxonomy role |
contribution | Text | Contribution in prose, when CRediT is too coarse |
funding — Funding. Who paid for the work, and what part they played in it. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
funder | Text | Funder name | |
grant | Text | Grant or award number | |
recipient | Word | The author who holds it | |
doi | Text | Funder DOI from the Open Funder Registry | |
amount | Quantity | Amount, with its currency | |
role | Word | One of design, collection, analysis, interpretation, writing, decision_to_publish, none | The funder's role in the work — journals require this stated, including when it is none |
statement | Text | Funding statement as it should print | |
of | Block id | What the funding supports |
licence — Licence. The licence the figure is released under, and how it should be credited. The id is optional.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
spdx | Text | SPDX identifier — CC-BY-4.0 | |
name | Text | Licence name | |
url | Text | Licence text address | |
holder | Text | Copyright holder | |
year | Number | Whole number from 1400 to 2200 | Copyright year |
reuse | Word | One of cc_by, cc_by_sa, cc_by_nc, cc_by_nc_sa, cc_by_nd, cc_by_nc_nd, cc0, public_domain, all_rights_reserved, custom | Reuse terms |
statement | Text | Licence statement as it should print | |
of | Block id | What the licence covers | |
attribution | Text | How reusers should credit the figure |
Machine learning and evaluation
Models, datasets, evaluations, ablations and the protocol, compute, search and model-card statements a machine-learning report needs.
model — Model. A model being evaluated. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Model name | |
params | Number | Number of parameters | |
family | Text | Model family |
dataset — Dataset. A dataset: an evaluation split, or a data file with where it came from, its licence and its availability. Takes an id. Data binding uses it too: see Data binding.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Dataset name | |
n | Number | Number of records | |
split | Text | Which split this is, such as train or test | |
path | Text | Relative path to the data file | |
url | Text | Where the data can be fetched or cited from | |
doi | Text | DOI of the deposited dataset | |
format | Word | csv, tsv, json, ndjson, parquet, xlsx, inline | |
delimiter | Text | Field separator, when it is not the format default | |
header | true/false | First row holds column names | |
rows | Number | Row count. Checked against the rows bound on the Data bench | |
columns | Number | Column count. Checked against the rows bound on the Data bench | |
hash | Text | Content digest of the data file | |
licence | Text | Licence the data is released under | |
accessed | Text | Date the data was retrieved | |
citation | Text | How the data should be cited | |
availability | Text | Data-availability statement — open, on-request, restricted, plus the conditions | |
description | Text | What the data are | |
inline | Text | The data itself, for a figure small enough to carry it |
eval — Evaluation. One model's score on one dataset. Takes an id. Read by the ablation_table view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
model | Block id | Required | The model evaluated |
dataset | Block id | Required | The dataset it was evaluated on |
metric | Text | Required | Metric name |
score | Number | The score | |
ci | List of block ids | Interval, as a list |
ablation — Ablation. One change from a baseline evaluation, and what it did to the metric. Takes an id. Read by the ablation_table view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
base | Block id | The eval this ablation is compared against | |
delta | Number | Change in the metric. A missing delta is read as zero | |
change | Text | What was removed or changed |
ml_protocol — ML evaluation protocol. How a machine-learning evaluation was actually run — task, seeds, metric definition, preprocessing, leakage checks and where the code is. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
task | Text | What the model was asked to do — the task, the label space, the unit of prediction | |
seeds | List of numbers | The random seeds actually used. Without them the reported runs cannot be reproduced and the spread across seeds cannot be read back | |
metric_definition | Text | How the headline metric is computed and what its interval is over — a bootstrap over test items is not the spread across seeds | |
preprocessing | Text | The preprocessing and augmentation, and — the part that decides whether the number means anything — which split its constants were fitted on | |
deduplication | Text | How overlap between the splits was checked and what was found. The answer to "did the test set leak" | |
code | Text | Where the code and configuration are, at which tag or commit | |
compute_note | Text | Pointer to the compute figures when they live in an ml_compute block |
ml_compute — Compute cost. What the experiments cost to run — hardware, accelerator hours, the total number of runs, and the energy. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
hardware | Text | The accelerators, how many of them, and the software stack | |
accelerator_hours | Number | At least 0 | Total accelerator hours, or the wall-clock time the runs took |
total_runs | Number | Whole number, 0 or more | Every run, including the ones discarded in development that appear nowhere in the results |
energy | Text | Energy consumed, and whether it was measured or estimated | |
note | Text | What the run count is made of — search trials, seed replicates, discarded runs |
ml_search — Hyperparameter search. The hyperparameter search behind a reported configuration — the space, the budget, and how the winner was picked. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
space | Text | The ranges and options searched over | |
trials | Number | Whole number, 0 or more | How many configurations were actually trained. The best of 200 and the best of 2 are not the same claim |
selection_metric | Text | The criterion the winning configuration was chosen on | |
selection_split | Block id | The dataset split the selection happened on. Naming a split the document does not declare is the leakage this item exists to catch | |
chosen | Text | The configuration the reported numbers actually use | |
note | Text | Anything else the reader needs — per-model budgets, when the test split was first read |
model_card — Model card. What a clinical prediction model or AI system is for and who it is not for — intended use, ground truth, oversight, monitoring. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
of | Block id | The model this card describes | |
version | Text | The version of the model this card is about | |
intended_use | Text | What the model is for, at which decision point, and how its output is meant to be acted on | |
out_of_scope_use | Text | Uses the model is not validated for and must not be put to | |
target_population | Text | The population the model was developed and validated in, and who falls outside it | |
users | Text | Who is expected to read the output and act on it | |
ground_truth | Text | How the reference labels were defined, and against what standard | |
annotation | Text | Who annotated the data, how many annotators, and their agreement | |
fairness | Text | Which groups performance was examined in, and what was found. The per-group numbers belong in subgroup blocks; this frames them | |
human_oversight | Text | What a human does with the output, and what happens when they disagree with it | |
monitoring | Text | What is monitored after deployment, how often, and what triggers a review | |
updating | Text | When and how the model is retrained or recalibrated, and how a change is communicated | |
caveats | Text | Known failure modes, and the caveats a reader must carry away |
Biology and laboratory
Laboratory experiments, samples, conditions, assays and the animals a study used.
experiment — Experiment. A laboratory experiment and the model system it uses. Takes an id. Typical children: sample, condition, assay, view, note. Read by the experiment_flow view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Experiment title | |
model | Text | The model system, such as a cell line or organism |
sample — Sample. A sample and its replicates. Takes an id. Read by the experiment_flow view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
n | Number | Number of samples | |
replicates | Number | Replicates per sample | |
from | Block id | The block this sample was drawn from |
condition — Condition. One experimental condition: what, how much and for how long. Takes an id. Read by the experiment_flow view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Condition name | |
dose | Text | Dose, as written | |
duration | Text | Duration, as written |
assay — Assay. An assay and what it reads out. Takes an id. Read by the experiment_flow view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
kind | Text | Kind of assay | |
readout | Text | What the assay reads out |
animal — Animals. The animals a study used — species, strain, sex, age, provenance, health and genetic status, and what they had already been through. Takes an id. Read by the experiment_flow view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
species | Text | The species, ideally as the binomial — Mus musculus | |
strain | Text | Strain and substrain exactly as published — C57BL/6JRj | |
sex | Text | Sex, and the split between the sexes when both were used | |
age | Text | Age or developmental stage when the procedures began | |
weight | Text | Weight or weight range at the start, where it is relevant — 18 to 22 g | |
provenance | Text | Where the animals came from — supplier or in-house colony — and any acclimatisation before the work began | |
health_status | Text | Health, immune or microbiological status, with the screening behind the claim — specific-pathogen-free | |
genetic_status | Text | Genetic modification status and genotype, or that the animals were wild-type | |
previous_procedures | Text | Any procedure these animals had already undergone, or that they were naive |
Surveys and qualitative research
Survey instruments and qualitative coding trees with their quotations.
instrument — Survey instrument. A survey instrument: who it is for, how it is administered and in what language. Takes an id. Typical children: construct, item, view, note. Read by the item_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Required | Instrument title |
audience | Text | Who the instrument is for | |
mode | Text | web, phone, paper, sms | |
language | Text | Language of the instrument |
construct — Construct. A latent concept that a set of items measures. Takes an id. Read by the item_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | Required | Latent concept the items measure |
definition | Text | Operational definition | |
reference | Text | Citation if borrowed from a published scale |
item — Item. One survey question, the construct it measures and its response scale. Takes an id. Read by the item_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
text | Text | Required | Question text as the respondent reads it |
construct | Block id | Construct this item measures | |
scale | Text | likert-5, likert-7, binary, multi, open | |
reverse | true/false | True if scoring is inverted |
theme — Theme. One node of a qualitative coding tree — its label, its coding definition, and the parent theme it sits under. Takes an id. Read by the theme_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
label | Text | The theme as it should read, in the participants' own terms | |
description | Text | The definition a second coder would apply — what distinguishes this theme from its siblings | |
of | Block id | The parent theme this is a sub-theme of. A sub-theme with no parent is a root theme; a sub-theme whose parent is misspelt is now an error rather than a silently orphaned root | |
major | true/false | This is a major theme rather than a sub-theme of another |
quotation — Participant quotation. A verbatim participant quotation, who said it, and the theme it is offered as evidence for. Takes an id. Read by the theme_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
text | Text | The quotation verbatim, exactly as the participant said it | |
participant | Text | The participant identifier it is attributed to — P04 | |
of | Block id | The theme this quotation grounds. A theme with no quotation attached rests on nothing a reader can see |
Project management
Projects, tasks, milestones and sprints.
project — Project. A project with its dates and owner. Takes an id. Typical children: milestone, task, sprint, view, note. Read by the gantt view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Project title | |
start | Text | Start date (YYYY-MM-DD) | |
end | Text | End date (YYYY-MM-DD) | |
owner | Text | Who owns the project |
milestone — Milestone. A dated milestone. Takes an id. Read by the gantt view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
date | Text | Required | Milestone date (YYYY-MM-DD) |
title | Text | Milestone name | |
status | Text | planned, at-risk, done |
task — Task. A task with dates, dependencies and an assignee. Takes an id. Read by the gantt view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Required | Task name |
start | Text | Start date (YYYY-MM-DD) | |
end | Text | End date (YYYY-MM-DD) | |
depends | List of block ids | Tasks this one waits for, as [task_a, task_b] | |
assignee | Text | Who does the task | |
status | Text | Task status |
sprint — Sprint. A sprint with its dates and points. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
start | Text | Sprint start date | |
end | Text | Sprint end date | |
points | Number | Story points in the sprint |
Engineering and architecture
Systems, services, datastores and actors for architecture views.
system — System. A software system and its owner. Takes an id. Typical children: service, datastore, actor, view, note. Read by the c4_container view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | System name | |
owner | Text | Who owns the system |
service — Service. A service inside a system, with what it depends on. Takes an id. Read by the c4_container view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Service name | |
runtime | Text | Runtime or language | |
depends | List of block ids | Services, datastores or actors this one calls, as a list of ids | |
tier | Text | Which row it sits in: edge or frontend, core or backend, or data |
datastore — Datastore. A database, cache or store. Takes an id. Read by the c4_container view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
kind | Text | Kind of store, such as postgres, redis or s3 | |
title | Text | Datastore name |
actor — Actor. A user or external system that interacts with the system. Takes an id. Read by the c4_container view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Actor name | |
kind | Text | user, external system, scheduler | |
depends | List of block ids | The containers this actor uses, one arrow each in the c4_container view |
Business and strategy
Initiatives, KPIs, customer segments and conversion funnels.
initiative — Initiative. A business initiative with an owner and horizon. Takes an id. Typical children: kpi, segment, view, note. Read by the okr_grid view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Initiative name | |
owner | Text | Who owns the initiative | |
horizon | Text | Time horizon, such as a quarter |
kpi — KPI. A key performance indicator with a baseline and target. Takes an id. Read by the okr_grid view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Required | KPI name |
baseline | Number | Starting value | |
target | Number | Target value | |
unit | Text | Unit of the KPI |
segment — Customer segment. A customer segment with its size and contract value. Takes an id. Read by the okr_grid view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Segment name | |
size | Number | Number of customers in the segment | |
acv | Number | Annual contract value |
funnel_step — Funnel step. One step of a conversion funnel and how many reached it. Takes an id. Read by the funnel view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
n | Number | Required | How many reached this step |
from | Block id | The previous step | |
title | Text | Step name |
Finance
Cap tables, shareholders, option pools and funding rounds.
cap_table — Cap table. A company's capitalisation table. Takes an id. Typical children: shareholder, round, option_pool, view, note. Read by the captable view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
currency | Text | ISO 4217 — USD, EUR, GBP, NGN… | |
title | Text | Cap table title | |
formed | Text | Date the company / cap table was formed |
shareholder — Shareholder. A holder of shares, their class and their role. Takes an id. Read by the captable view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | Required | Shareholder name |
shares | Number | Required | Common / preferred share count |
class | Text | common, preferred, seed, series-a … | |
role | Text | founder, employee, investor, advisor |
option_pool — Option pool. An employee option pool and how much of it is granted. Takes an id. Read by the captable view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
shares | Number | Required | Authorised pool size |
granted | Number | Shares already granted (default 0) | |
label | Text | Label for the pool |
round — Funding round. A funding round: how much was raised, at what valuation and from whom. Takes an id. Read by the captable view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | Required | Seed, Series A, Bridge… |
raise | Number | Required | Cash raised in this round |
pre_money | Number | Pre-money valuation | |
lead | Text | Lead investor name | |
date | Text | Round date |
Security (threat modelling)
STRIDE and LINDDUN threat models.
threat_model — Threat model. A threat model and the framework it follows. Takes an id. Typical children: asset, threat, control, view, note. Read by the risk_matrix view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
framework | Text | STRIDE, LINDDUN, PASTA, custom | |
title | Text | Threat model title | |
scope | Text | What is in scope |
asset — Asset. Something worth protecting, and why. Takes an id.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | Required | Asset name |
value | Text | Why it matters: PII, IP, revenue path… | |
classification | Text | public, internal, confidential, restricted |
threat — Threat. A threat to an asset, rated for likelihood and impact. Takes an id. Read by the risk_matrix view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Required | Threat name |
asset | Block id | Asset this threatens | |
category | Text | spoofing, tampering, repudiation, info-disclosure, dos, elevation | |
likelihood | Number | 1 (rare) → 5 (almost certain) | |
impact | Number | 1 (negligible) → 5 (severe) |
control — Control. A control that reduces one or more threats. Takes an id. Read by the risk_matrix view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Required | Control name |
mitigates | List of block ids | Threats this control reduces | |
type | Text | preventive, detective, corrective | |
coverage | Number | 0..1 — fractional reduction in likelihood | |
owner | Text | Who owns the control |
Reliability (FMEA)
Failure mode and effects analysis.
fmea — FMEA. A failure mode and effects analysis. Takes an id. Typical children: failure_mode, mitigation, view, note. Read by the fmea_table view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Required | FMEA title |
system | Text | System / process being analysed | |
team | Text | Team that ran the analysis | |
revision | Text | Revision |
failure_mode — Failure mode. One way a component fails, rated for severity, occurrence and detection. Takes an id. Read by the fmea_table view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
component | Text | Required | The component that fails |
mode | Text | Required | How it fails |
cause | Text | Why it fails | |
effect | Text | Downstream effect | |
severity | Number | 1 (negligible) → 10 (catastrophic) | |
occurrence | Number | 1 (very rare) → 10 (very frequent) | |
detection | Number | 1 (always caught) → 10 (never caught) |
mitigation — Mitigation. An action against a failure mode and the ratings it aims for. Takes an id. Read by the fmea_table view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
mode | Block id | Required | Failure mode this addresses |
action | Text | Required | What is done about it |
owner | Text | Who does it | |
target_severity | Number | Severity after the mitigation | |
target_occurrence | Number | Occurrence after the mitigation | |
target_detection | Number | Detection after the mitigation |
Supply chain
Supply-chain networks.
supply_chain — Supply chain. A supply chain for one product. Takes an id. Typical children: sc_node, sc_link, view, note. Read by the supply_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
product | Text | Required | The product that flows through the chain |
currency | Text | Currency, as an ISO 4217 code such as USD, EUR or GBP | |
title | Text | Chain title |
sc_node — Supply node. A supplier, factory, warehouse, distributor or customer. Takes an id. Read by the supply_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | Required | Node name |
role | Text | supplier, factory, warehouse, customer | |
location | Text | Where the node is | |
capacity | Number | Units per period |
sc_link — Supply link. A link between two nodes with its lead time, cost and transport mode. Takes an id. Read by the supply_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
from | Block id | Required | Upstream node |
to | Block id | Required | Downstream node |
lead_time_days | Number | Lead time in days | |
cost_per_unit | Number | Cost per unit moved | |
mode | Text | truck, rail, sea, air |
Education
Assessment rubrics.
rubric — Rubric. An assessment rubric. Takes an id. Typical children: criterion, level, view, note. Read by the rubric_grid view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Required | Rubric title |
course | Text | Course | |
assignment | Text | Assignment | |
author | Text | Who wrote the rubric |
criterion — Criterion. One criterion of a rubric and its weight. Takes an id. Read by the rubric_grid view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | Required | Criterion name |
weight | Number | Relative weight (e.g. 0.25) | |
description | Text | What the criterion assesses |
level — Performance level. One performance level of a criterion and the points it earns. Takes an id. Read by the rubric_grid view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
criterion | Block id | Required | The criterion this level belongs to |
label | Text | Required | Emerging, Developing, Proficient, Exemplary |
points | Number | Score awarded at this level | |
descriptor | Text | What this level looks like |
Legal
Agreements, parties, clauses and obligations.
agreement — Agreement. A contract or agreement. Takes an id. Typical children: party, clause, obligation, view, note. Read by the clause_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Required | Agreement title |
type | Text | Kind of agreement, such as NDA, SaaS, DPA, MSA or employment | |
governing_law | Text | Governing law | |
effective | Text | Effective date |
party — Party. A party to the agreement. Takes an id. Read by the clause_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
name | Text | Required | Party name |
role | Text | buyer, seller, licensor, licensee, discloser, recipient | |
jurisdiction | Text | Jurisdiction |
clause — Clause. A clause and the party it mainly affects. Takes an id. Read by the clause_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Required | Clause title |
type | Text | obligation, right, condition, warranty, covenant | |
party | Block id | Party primarily affected | |
summary | Text | Plain-language summary | |
section | Text | Section number, such as 3.2.1 |
obligation — Obligation. Something a party must do, by when, and what happens if it does not. Takes an id. Read by the clause_map view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
party | Block id | Required | The party that owes the obligation |
action | Text | Required | What must be done |
deadline | Text | When | |
penalty | Text | Consequence of missing it |
Free-form 2D figures
Free-form 2D schematics drawn from shapes, labels, arrows and callouts.
figure — Figure (2D). Free-form 2D schematic — physics figures, anatomy, optics, custom diagrams. Takes an id. Typical children: shape, label_2d, group_2d, arrow_2d, annotation, view, note. Read by the figure view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Figure title | |
width | Number | Drawing width | |
height | Number | Drawing height | |
background | Text | Background colour, hex or named |
shape — Shape. A shape in a 2D figure. The id is optional. Read by the figure view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
kind | Text | rect, circle, ellipse, triangle, polygon, line, path | |
x | Number | Horizontal position (drag the shape on the canvas to change it) | |
y | Number | Vertical position (drag the shape on the canvas to change it) | |
w | Number | Width | |
h | Number | Height | |
r | Number | Radius (circles) or corner radius (rects) | |
points | List of block ids | [x1, y1, x2, y2, ...] for polygons / paths | |
fill | Text | Fill colour, hex or named | |
stroke | Text | Outline colour, hex or named | |
strokeWidth | Number | Outline width | |
dashed | true/false | Draw the line dashed | |
label | Text | Text drawn on the shape | |
labelPos | Text | center, top, bottom, left, right | |
rotate | Number | Rotation in degrees around centre |
label_2d — Label (2D). A text label in a 2D figure. The id is optional. Read by the figure view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
text | Text | Required | The text |
x | Number | Required | Horizontal position |
y | Number | Required | Vertical position |
anchor | Text | start, middle, end | |
size | Number | Text size | |
weight | Text | normal, bold | |
color | Text | Colour, hex or named | |
rotate | Number | Rotation in degrees |
arrow_2d — Arrow (2D). An arrow between two shapes or two points. The id is optional. Read by the figure view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
from | Block id | Shape or group the arrow starts at | |
to | Block id | Shape or group the arrow ends at | |
x1 | Number | Start x, when not using from | |
y1 | Number | Start y, when not using from | |
x2 | Number | End x, when not using to | |
y2 | Number | End y, when not using to | |
label | Text | Text on the arrow | |
color | Text | Colour, hex or named | |
dashed | true/false | Draw the line dashed | |
head | Text | end, both, none |
group_2d — Group (2D). A group of 2D elements moved, rotated or scaled together. Takes an id. Typical children: shape, label_2d, arrow_2d, annotation, group_2d. Read by the figure view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
x | Number | Horizontal position | |
y | Number | Vertical position | |
rotate | Number | Rotation in degrees | |
scale | Number | Scale factor for everything in the group |
annotation — Annotation callout. A callout pointing at another element. The id is optional. Read by the figure view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
target | Block id | The block the callout points at | |
text | Text | Required | Callout text |
offsetX | Number | Horizontal offset from the target | |
offsetY | Number | Vertical offset from the target | |
style | Text | footnote, margin, inline, significance |
3D and isometric scenes
Isometric 3D scenes drawn from boxes, spheres, cylinders, planes, edges and labels.
scene — Scene (3D / isometric). 3D scene rendered via isometric projection — molecules, lattices, geometric proofs. Takes an id. Typical children: box3d, sphere3d, cylinder3d, plane3d, label3d, edge3d, view, note. Read by the scene view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
title | Text | Scene title | |
projection | Text | isometric, dimetric, orthographic | |
width | Number | Drawing width | |
height | Number | Drawing height | |
grid | true/false | Show ground grid | |
axes | true/false | Show x/y/z axes |
box3d — Box (3D). A box in a 3D scene. The id is optional. Read by the scene view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
x | Number | Horizontal position | |
y | Number | Vertical position | |
z | Number | Depth position | |
w | Number | Width | |
h | Number | Height | |
d | Number | Depth along z | |
fill | Text | Fill colour, hex or named | |
stroke | Text | Outline colour, hex or named | |
label | Text | Text on the box |
sphere3d — Sphere (3D). A sphere in a 3D scene. The id is optional. Read by the scene view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
x | Number | Horizontal position | |
y | Number | Vertical position | |
z | Number | Depth position | |
r | Number | Radius | |
fill | Text | Fill colour, hex or named | |
stroke | Text | Outline colour, hex or named | |
label | Text | Text on the sphere |
cylinder3d — Cylinder (3D). A cylinder in a 3D scene. The id is optional. Read by the scene view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
x | Number | Horizontal position | |
y | Number | Vertical position | |
z | Number | Depth position | |
r | Number | Radius | |
h | Number | Height | |
fill | Text | Fill colour, hex or named | |
stroke | Text | Outline colour, hex or named | |
label | Text | Text on the cylinder |
plane3d — Plane (3D). A flat plane in a 3D scene. The id is optional. Read by the scene view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
x | Number | Horizontal position | |
y | Number | Vertical position | |
z | Number | Depth position | |
w | Number | Width | |
d | Number | Depth | |
fill | Text | Fill colour, hex or named | |
stroke | Text | Outline colour, hex or named |
edge3d — Edge (3D bond / strut). A bond or strut between two 3D primitives. The id is optional. Read by the scene view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
from | Block id | Primitive the edge starts at | |
to | Block id | Primitive the edge ends at | |
color | Text | Colour, hex or named | |
width | Number | Line width | |
dashed | true/false | Draw the line dashed |
label3d — Label (3D). A text label placed in a 3D scene. The id is optional. Read by the scene view.
| Attribute | Type | Rules | Meaning |
|---|---|---|---|
text | Text | Required | The text |
x | Number | Horizontal position | |
y | Number | Vertical position | |
z | Number | Depth position | |
color | Text | Colour, hex or named | |
size | Number | Text size |
Messages reference
Every message appears in the editor as an underline on the characters at fault and in the status badge's Validation list, worst first. Click an entry in the list to jump to its line. An error is something wrong that you must fix, a warning is probably wrong, and a note is information. The Lab still draws what it can while errors remain, but the document does not count as passing until they are fixed, and the badge keeps counting them.
Reading the document
These come from reading the text itself. The first three stop the whole document being read, so nothing at all is drawn until they are fixed.
| Message | Cause | Fix |
|---|---|---|
| "Unterminated string literal" | A " with no closing " on the same line | Close the string on the line it starts |
| "Unterminated /* … */ block comment" | A /* with no */ | Close the comment |
| "Unexpected character "/"" (or another character) | A character the language does not use, often from a unit written in a form the Lab cannot read in an attribute | See Writing a unit; quote anything that is text |
| "Expected a block kind (e.g. "study", "cohort"), got "…"" | Something other than a word where a block should start | Start each block with its kind |
| "Expected '{' to open block body, got "…"" | A kind and id with no { | Add the braces |
| "Expected '}', got "eof"" | A block that is never closed | Add the missing } |
| "Unexpected token "…" inside block" | Something in a block body that is neither name: value nor a nested block | Check for a missing colon, a stray word, or a unit the Lab could not read |
| "Expected a value, got "…"" | A colon with nothing usable after it | Give the attribute a value |
| "Unexpected token "…" inside object" | An object entry that is not name: value | Write each entry as name: value |
| "Unexpected token "…" in view arguments" | Something other than an id, string or number in view v: r( … ) | Use ids, quoted strings or numbers |
"An interval after a number must be written [lo, hi] or (lo to hi)." | A bracket after a number that is not a valid interval | Separate the bounds with , or to |
"± must be followed by the uncertainty, e.g. 12.4 ± 0.8." | ± with no number after it | Add the half-width |
"@ sets the coverage of an uncertainty and must follow one, e.g. 0.68 [0.51, 0.90] @ 90%." | @ after a plain number | Add the interval, or remove the coverage |
When the parser hits a mistake it skips to the next block, so the blocks around a mistake still compile and are still drawn where possible.
The schema
| Message | Severity | Fix |
|---|---|---|
"Block "cohort" should have an identifier (e.g. cohort my_id { … })." | Warning | Give the block an id |
| "Duplicate id "x" — every block id must be unique." | Error | Rename one of them (F2) |
"Attribute "x" is not part of the kind schema — it will be carried through as freeform data." | Warning | Check the spelling against the reference; if the attribute is intentional, ignore the warning |
"kind is missing required attribute name." | Error | Add it |
"child is not a typical child of parent (allowed: …)." | Warning | Move the block, or ignore if the nesting is intended |
"key is 95, above the maximum of 1 — …" / "… below the minimum of 0 — …" (followed by the attribute's own description) | Error | Use the range the attribute expects; a coverage level is a fraction such as 0.95 |
"key is 12.5, and this is a count — counts are whole numbers. If this is a mean or a rate, it needs a different attribute." | Error | Use a whole number, or the attribute meant for a mean or rate |
"key is x, which is not one of: …" | Error | Use one of the listed words |
"key is in mmHg (pressure), but this attribute holds time — e.g. d." | Error | Use a unit of the right kind |
"key is a proportion or percentage, so kg (mass) cannot be its unit. Write it as 3.2%, as a fraction, or with a ratio unit such as per 1000." | Error | Write a percentage, fraction or ratio |
References
| Message | Severity | Fix |
|---|---|---|
"Reference x does not resolve — no block declared with id "x"." | Error | Declare the block, or correct the id |
"Reference a.b does not resolve — block "a" has nothing named b." | Error | Correct the attribute name |
Units
| Message | Severity | Fix |
|---|---|---|
"Unit x on key is not recognised: … The number is kept; the unit is carried through as text." | Warning | Use a unit from the table |
| "… is outside the plausible range (…) — …" | Warning | Check the value and unit; ignore it if the value really is unusual |
| "… is negative, and … is not. If this is a change or a difference, name it as one." | Warning | Put the unit in unit: for a difference measure |
| "A count of participants cannot be negative; got …" | Error | Correct the count |
| "… participants is not a whole number — counts are integers, so this is probably a rate or a mean." | Warning | Correct it, or use a rate unit |
| "A duration of … is negative — durations run forwards." | Error | Correct the duration |
| "… is … K — below absolute zero, which is physically impossible." | Error | Correct the temperature |
| "A proportion must lie in 0–1; got …" | Error | Use a fraction, or the % unit |
| "A p-value must lie in 0–1; got …" | Error | Correct the p-value |
"A p-value of exactly 0 is not attainable — report it as p < 0.001." | Note | Write the p-value as text |
| "… exceeds 100. A percentage of a whole cannot; …" | Warning | Correct it, or label it as a relative change |
"Unit mismatch: a is in … but b is in … — these do not measure the same thing." | Error | Use units of one kind in the numbers being compared |
"Ambiguous scale: a is a plain … but b is in %. Give a a unit …" | Error | Give the plain number a unit |
Uncertainty
See the table in What is checked in an estimate. Also:
| Message | Severity | Fix |
|---|---|---|
| "… the interval and the p-value disagree. … One of the two was copied from a different analysis." | Warning | Check both against the source analysis |
| "… states its estimate twice and the two disagree: …" | Warning | Keep value or the separate parts, not both |
| "… was computed without the uncertainty of …" | Note | Write the estimate inline as value: … [lo, hi] if the interval should flow into the expression |
Expressions
| Message | Severity | Fix |
|---|---|---|
| "Empty expression — there is nothing to compute." | Error | Write the expression after = |
"x does not resolve to a value — check the block id and attribute name." | Error | Correct the path |
"Circular definition: a → b → a. One of these has to be written out as a number." | Error | Break the loop |
"Use == to compare, not =." | Error | Write == |
"Use not for negation, and != for inequality." | Error | Replace ! |
"Comparisons do not chain — write a < b and b < c instead." | Error | Split the comparison |
"foo is not a built-in function. Available: …" | Error | Use a built-in function |
"name takes … arguments, got …." | Error | Correct the number of arguments |
"The field of an aggregate must be a quoted name, e.g. sum(kind:arm, "n")." | Error | Quote the field |
"sum over blocks needs a field: sum(kind:arm, "n")." | Error | Add the field |
| "Nothing matched over … so this total is 0. Check the selector." | Warning | Correct the kind or id in the selector |
"mean needs at least one value; nothing matched …" | Error | Correct the selector |
"Division by zero — guard the denominator, e.g. if(denom > 0, num / denom, 0)." | Error | Guard the denominator |
| "A percentage of zero is undefined — the denominator is 0.", "A ratio with a zero denominator is undefined.", "A rate with a zero population is undefined." | Error | Guard the denominator with if |
| "sqrt of a negative number (…) has no real value." / "ln requires a positive number, got …" | Error | Check the input |
"Cannot add mg and mL — …" | Error | Combine quantities of one kind |
"The condition of if must be true or false, got a number — this language has no truthiness, write the comparison out." | Error | Write a comparison |
"Cannot compare … with …" / "< compares numbers, not text …" | Error | Compare like with like |
| "Cannot subtract these two estimates — …" (or add, multiply, divide) | Error | State the derived quantity as an estimate of its own |
"median has no uncertainty algebra, so the result is a point estimate and the interval stops here. …" | Note | Nothing to fix; the interval is not carried |
"key: = … did not produce a number." | Error | Make the expression produce a number |
"key cannot be derived: key holds a truth value, but nothing reads the answer to a condition written there …" | Error | Write true or false, or move the condition into a check |
| "Expression nests more than 64 levels deep." / "Expression is … characters; the limit is 20000." | Error | Simplify, or use an aggregate |
Checks
See Checks. Violations are reported as "Check name: …" at the severity you set; a check that cannot be run is always an error.
Views
See View lines.
Arithmetic and data
See The arithmetic the Lab checks.
Editor support
The Lab's source editor understands FlowScript:
| Feature | How |
|---|---|
| Highlighting | Block kinds, numbers, strings, comments, true/false/null/source, and the operators ±, +/-, = and @ |
| Completion | Block kinds at the start of a line; a kind's attributes (required first) and typical children inside a block; renderers after view name:. Snippets seed the right notation: 0 [0, 0] for an estimate, 0 d for a duration, = sum(kind:arm, "n") for an expression |
| Hover | A number's resolved value, interval and source; a block's numbers; a kind's attributes |
| Go to definition, find references | F12, ⇧F12 |
| Rename | F2 on a block id |
| Format | ⇧⌥F: re-indents by braces, leaves strings, comments and in-line alignment alone, and does nothing while braces are unbalanced |
| Comments | ⌘/ toggles a line comment |
| Brackets | {, [, ( and " close themselves |
See Lab for the rest of the studio around the editor.
Tips
- Start from a template or the Insert flyout. They write the required attributes and the right notation for you.
- Write ids in
snake_case. Letters, digits and underscores keep ids usable in expressions and renameable withF2. - Give every flow box an
excludedobject. The Lab can then prove the flow balances at every step, and the CONSORT figure prints the reasons. - Derive what you can.
n: = randomised.n - excluded.withdrewandrate: = events / n * 100cannot drift from the counts. - Write estimates inline (
value: 0.68 [0.51, 0.90]) when other values are computed from them, so the interval flows through. - Put a difference measure's unit in
unit:, not on the number, to keep plausibility ranges for absolute values off a change. - Use
measure:on every estimate. It decides the scale; a ratio measure on the identity scale has a symmetric interval, which is wrong. - Turn house rules into
checkblocks with a clearelse:that quotes the number, so the message says what to fix. - Record sources on numbers you copied from tables (
source "Table 2"), so Provenance can account for them.
Limits and known constraints
- A string must fit on one line; use
\nfor a line break inside text. - In an attribute value, a unit cannot contain a comma (
per 100,000), a space before a word (fl oz,per 1000 py) or a hyphenated name (person-years). Useper 100000,floz,py. %inside an expression is the remainder operator; write12[%].- Only objects one level deep are lifted into numbers you can reference (
a.control.events), not objects inside objects, and not list elements. - An expression must produce a number, except in
check'sthat:. A path in an expression reads numbers and text, nottrue/falseattributes. - Uncertainty flows only from inline estimates, only through
+,-,*,/,^,ln,exp,sumandmean, and not through aggregates over a selector. - The p-value check against an estimate's interval runs only for estimates written with separate
point,lo,hiorse. - In the block form of a view,
renderer:must be a quoted string; a bare word is not read and the view falls back to the CONSORT renderer. level: 95on a block is an error; writelevel: 0.95. Inside an inline estimate,@ 95is read as 95%.- Only chi-squared and Fisher's exact tests are recomputed from counts.
- The line numbers in messages are recomputed on every change, so they always match the text. Comment threads are different: they are anchored to a line number, so editing above a commented line moves the text under the comment without moving the comment.
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| Nothing draws and the badge shows one error at a quote mark | An unclosed string | Close the " on the same line |
| "Unexpected token" errors after a number with a unit | A unit form the attribute cannot read (comma, hyphen, two words) | Rewrite it (per 100000, py, floz) |
| An arithmetic inconsistency you cannot see | A typo in an exclusion count, or a missing excluded entry | The message prints the parent, the excluded sum and the child; add or correct the entry |
| A derived value shows "not resolved" on hover | Its expression has an error | Read the message on the expression; usually a misspelt path |
| A check you believe in fails | The selector matched nothing (look for the "Nothing matched" warning), or a misspelt kind | Correct the selector |
| A view draws the wrong figure | A block-form view with renderer: written as a bare word | Quote it: renderer: "forest" |
| A view draws an empty figure | Its argument names no block, or the blocks it needs are missing | Read the warning; see Lab views and renderers |
level above the maximum | A coverage written as a percentage | Write level: 0.95 |
| A unit warning on a mean difference | The unit on a change triggered an absolute-value range | Move the unit to unit: |
| "Ambiguous scale" | A plain number beside a % | Give it a unit |
F2 refuses to rename | The new id is taken, invalid (hyphens are not allowed) or the document does not compile | Choose another id or fix the errors first |
Related pages
- Lab
- Lab views and renderers
- Reporting standards
- The Data and Statistics benches
- Publishing, provenance and compliance in Lab
- Core concepts and glossary
- Choosing an engine, for the other diagram languages in the Studio
- Troubleshooting and FAQ
