Hard-Coded Value

Hard-coded values are numbers typed into a health economic model's formulas or code rather than linked to named inputs, hiding assumptions from reviewers.

Status
Published, version 1.0.0
Last reviewed
12 Nov 2026, by Dr Darrin Baines
Report a problem
Tell us if something is wrong or out of date

Concept Architecture

Hard-Coded Value in Health Economic Models

In a health economic model, a hard-coded value is a fixed number written inside a calculation, such as a spreadsheet formula that multiplies by 0.75, where the formula should instead point to the cell or variable holding that quantity. The number still drives the costs, QALYs and ICER, but it sits outside the list of inputs that reviewers, sensitivity analyses and later users rely on. Verification checklists treat such numbers as a transparency fault to be located before the calculations are tested, and the TECH-VER checklist names the absence of hardcoded values among its completeness checks. Hard-coding is a matter of technical verification, whether the model was built right, rather than of model validation in the narrower sense of whether it is the right model for the decision. Eddy and colleagues class verification, also called internal validity, as one of five types of validation, which is why a model validation tool can carry checks on hard-coding.

Where typed numbers belong in a model

Every model contains numbers that someone typed, so the question is where they sit. The CADTH (now CDA-AMC) model validation tool by Coyle and colleagues asks, as item 27, whether a clear trace links all input parameters to final outcomes, and explains this as only input parameters being hard coded. Read that way, a typed value is expected on the input sheet and is a fault anywhere in the chain of calculations. Item 53 of the same tool asks that all input parameters influencing results be provided transparently, preferably in a single worksheet, because a model input should be entered once and feed every part of the model that uses it.

The same applies to code. In an R script or a Visual Basic for Applications (VBA) routine, a hard-coded value is a number written inside a function body instead of being passed in as a named parameter input. Blissett and colleagues, comparing versions of the hip fracture simulation from NICE Decision Support Unit Technical Support Document 15, adapted the original VBA model to read parameters from an Excel table rather than hard-coded values, so that every version shared one input structure.

Why reviewers treat hard-coding as a fault

The CDA-AMC tool defines a clear trace as one in which every input can be traced to the final model output. Where it is unclear how an input relates to the output, the tool records the model as not sufficiently transparent and its results as impossible to validate properly. A hard-coded value can break that trace in three ways.

The first is the stale copy. When an analyst updates an input, a number typed elsewhere does not change with it. Coyle's tool notes that entering the same parameter several times across sheets introduces the likelihood of human error and makes editing hard, because each change must be made in several places.

The second concerns sensitivity analysis. A typed number does not move when its input is varied, so it silently drops out of one-way sensitivity analysis and probabilistic sensitivity analysis. TECH-VER warns that if not all relevant parameters are sampled in the PSA, parameter uncertainty is underestimated and the outcomes appear more certain than they are. Its uncertainty checks ask whether all necessary parameters are included in the one-way analysis and whether all sampled inputs in the PSA are correctly linked to the event and state calculations.

The third is the gap between report and model. NICE PMG36 (2022, updated 2026), section 5.5.15, says that a company submitting an executable model must give NICE full access to the programming code and should ensure that the submitted model and the written evidence submission match. A reviewer who checks the input table in the report against the model's input sheet will not see a number buried in a formula.

Radeva and colleagues reviewed the 41 single technology appraisals NICE completed in 2017 and found that transcription errors (29 per cent), logic errors (29 per cent) and computational errors (25 per cent) were the most frequent. In interviews reported by Chilcott and colleagues, modellers described keeping all model parameters in the same worksheet and copying formulae rather than hard coding numbers, and believed such housekeeping helps internal peer review by colleagues outside the build.

How verification finds hard-coded values

TECH-VER, the checklist by Büyükkaramikli and colleagues, makes a completeness and consistency check the prerequisite for each of its four calculation stages (inputs, event and state calculations, results and uncertainty analysis). The reviewer locates the calculations to be tested and checks completeness, which includes no hidden sheets, ranges or modules, no links to external programs, no hardcoded values and no password protection. The consistency part compares the model implementation with the description in the report and with the values in the reference source. TECH-VER adds that the Inquire tool in Excel can identify hidden sheets or ranges and hardcoded formulae in spreadsheet models.

Later tests catch what this first sweep misses. In black-box testing, an input that should move the results but does not, or moves only one arm, can point to a typed copy or a broken cell reference somewhere downstream. White-box testing then follows the trace by hand, and the CDA-AMC tool's items 47 and 48 ask whether a reviewer can trace the results back to where the inputs are entered, and trace any input forward into the results of a single Monte Carlo simulation. A hard-coded number is where such a trace breaks. This input-to-output trace runs through the formulas and differs from the cohort and entity traces that trace validation follows in simulation science. Coyle's tool also lists Excel practices that reduce the transparency needed for white-box testing, such as IFERROR and INDIRECT statements, hidden sheets and formulas embedded in macros.

The checklist asks for a model reviewer, preferably independent, and recommends documenting which verification efforts were conducted and which were omitted, with reasons. For NICE appraisals, PMG36 section 4.6.4 asks companies to detail the methods of quality assurance used in developing the model, and section 5.5.11 says NICE sends the submission to the External Assessment Group for review.

TECH-VER's hepatitis C example, a standard error fixed at zero that the Evidence Review Group found in the completeness and consistency checks, shows the same loss of uncertainty from a fixed value on the input side.

Worked example of a hard-coded hazard ratio

All numbers are illustrative. A two-state Markov cohort model with annual cycles follows people who start progression-free, with three cycles, no death and no discounting. Under standard care the annual probability of progression is 0.20. The new treatment applies a hazard ratio of 0.75, entered on the input sheet, through

p1=1−(1−p0)HRp_1 = 1 - (1 - p_0)^{HR}

where p1p_1 is the annual probability of progression with treatment, p0p_0 is the annual probability under standard care (0.20), and HRHR is the hazard ratio for progression with treatment versus standard care.

1. Treatment arm transitions. With HRHR = 0.75, (1−0.20)0.75=0.80.75=0.8459(1 - 0.20)^{0.75} = 0.8^{0.75} = 0.8459, so p1p_1 = 1 − 0.8459 = 0.1541.

2. State occupancy. The proportions progression-free at the start of cycles 1 to 3 are 1, 0.8 and 0.64 under standard care, and 1, 0.8459 and 0.8459 × 0.8459 = 0.7155 with treatment.

3. QALYs. With utilities of 0.8 progression-free and 0.6 after progression, each cycle gives 0.6 + 0.2 × the proportion progression-free. The progression-free proportions sum to 1 + 0.8 + 0.64 = 2.44 under standard care, which gives 1.8 + 0.2 × 2.44 = 2.288 QALYs, where 1.8 is three cycles at 0.6. With treatment they sum to 1 + 0.8459 + 0.7155 = 2.5614, which gives 1.8 + 0.2 × 2.5614 = 2.31228, or 2.3123 QALYs. The incremental gain is 2.3123 − 2.288 = 0.0243 QALYs.

4. The fault. The treatment arm's transition cell holds the formula =1-(1-B5)^0.75, where B5 is the standard care probability. The value 0.75 was typed in during an early draft and never linked to the hazard ratio cell. The base case is still correct, so the result alone gives no warning.

5. The black-box test that exposes it. Setting the hazard ratio input to 1 should give equal QALYs in both arms, one of the CDA-AMC tool's standard tests. The faulty model still gives 0.0243 incremental QALYs because the formula ignores the input. In a PSA, draws of 0.60 and 0.90 for the hazard ratio should give incremental gains of about 0.0400 and 0.0095 QALYs (progression-free proportions 0.8747 and 0.7651, or 0.8181 and 0.6693), but with the other inputs at their base-case values the faulty model returns 0.0243 for every hazard ratio draw, so the uncertainty in the treatment effect vanishes from the results.

6. Correction. Replacing 0.75 with a reference to the hazard ratio cell restores the response in both tests. A search of the calculation sheets for numeric constants, or the Inquire tool, could have flagged the cell before any testing.

Neighbouring terms

A hard-coded value differs from a parameter input, which is the legitimate typed value on the input sheet, and from a black box model, in which a whole model cannot be inspected. It overlaps with a transcription error, a number copied wrongly, but a hard-coded value may be correct when typed and become wrong only when the input changes. Model transparency, the extent to which others can review a model's structure, equations, parameter values and assumptions in the sense used by Eddy and colleagues, is the property that hard-coding reduces.

Limits and common misunderstandings

Removing hard-coded values makes a model checkable but not right. Eddy and colleagues note that verification helps ensure there are no unintentional computational errors but does not evaluate the accuracy of the model's structure or predictions, so a correctly linked but wrong input still gives a wrong answer. TECH-VER deliberately gives no verification score because a score might give a false sense of security, so a finding of no hard-coded values is one logged item in technical verification, read alongside validation against data and other models.

Sources

  • Blissett R, Sullivan W, Subban I, Igloi-Nagy A. Patient-level health economic modeling in Excel without VBA: a tutorial. PharmacoEconomics. 2026;44(5):527-538. https://doi.org/10.1007/s40273-025-01543-7
  • Büyükkaramikli NC, Rutten-van Mölken MPMH, Severens JL, Al M. TECH-VER: a verification checklist to reduce errors in models and improve their credibility. PharmacoEconomics. 2019;37(11):1391-1408. https://doi.org/10.1007/s40273-019-00844-y
  • Chilcott J, Tappenden P, Rawdin A, Johnson M, Kaltenthaler E, Paisley S, Papaioannou D, Shippam A. Avoiding and identifying errors in health technology assessment models: qualitative study and methodological review. Health Technology Assessment. 2010;14(25). https://doi.org/10.3310/hta14250
  • Coyle D, Haines A, Lee K. The development of a model validation tool to assist in the conduct of economic evaluations. Canadian Journal of Health Technologies. 2024;4(3). https://doi.org/10.51731/cjht.2024.862
  • Eddy DM, Hollingworth W, Caro JJ, Tsevat J, McDonald KM, Wong JB. Model transparency and validation: a report of the ISPOR-SMDM Modeling Good Research Practices Task Force-7. Value in Health. 2012;15(6):843-850. https://doi.org/10.1016/j.jval.2012.04.012
  • National Institute for Health and Care Excellence. NICE technology appraisal and highly specialised technologies guidance: the manual (PMG36). Published 31 January 2022, last updated 13 October 2026. Sections 4.6.4, 5.5.11 and 5.5.15. https://www.nice.org.uk/process/pmg36
  • Radeva D, Hopkin G, Mossialos E, Borrill J, Osipenko L, Naci H. Assessment of technical errors and validation processes in economic models submitted by the company for NICE technology appraisals. International Journal of Technology Assessment in Health Care. 2020;36(4):311-316. https://doi.org/10.1017/S0266462320000422

Frequently Asked Questions (6)

  • What is Hard-Coded Value?

    Hard-coded values are numbers typed into a health economic model's formulas or code rather than linked to named inputs, hiding assumptions from reviewers.

    Source: Coyle et al. 2024

  • Why do HTA reviewers treat a hard-coded value in a health economic model as a fault?

    The CDA-AMC model validation tool by Coyle and colleagues asks whether a clear trace links all input parameters to final outcomes, and it expects only input parameters to be hard coded. A number typed into a formula sits outside that trace, so a reviewer cannot see how it relates to the output. Where that relation is unclear, the tool records the model as not sufficiently transparent and its results as impossible to validate properly. The tool also notes that entering the same parameter several times across sheets raises the likelihood of human error and makes editing hard, because each later change must be made in several places.

    Source: Coyle et al. 2024

  • How does a hard-coded value affect probabilistic sensitivity analysis in a health economic model?

    A number typed into a formula does not move when its input is varied, so it drops out of one-way and probabilistic sensitivity analysis without any warning. The TECH-VER checklist by Büyükkaramikli and colleagues warns that if not all relevant parameters are sampled in a PSA, parameter uncertainty is underestimated and the outcomes appear more certain than they are. Its uncertainty checks ask whether all sampled inputs are correctly linked to the event and state calculations. In an illustrative Markov model with a hazard ratio typed into the transition formula, the incremental QALYs no longer respond to the hazard ratio draws, so the uncertainty in the treatment effect vanishes from the results.

    Source: Büyükkaramikli et al. 2019

  • How does the TECH-VER checklist help a reviewer find a hard-coded value in a company model?

    TECH-VER makes a completeness and consistency check the prerequisite for each of its four calculation stages, and completeness includes no hidden sheets, no links to external programs, no hardcoded values and no password protection. The checklist adds that the Inquire tool in Excel can identify hardcoded formulae in spreadsheet models. In the black-box tests that follow, an input that should move the results but does not can point to a typed copy or a broken cell reference somewhere downstream, and white-box testing then follows the trace by hand to the cell where it breaks. TECH-VER asks for a model reviewer, preferably independent, and for a record of which checks were done and which were omitted.

    Source: Büyükkaramikli et al. 2019

  • How can a hard-coded value open a gap between a NICE submission and its executable model?

    NICE PMG36 section 5.5.15 says a company submitting an executable model must give NICE full access to the programming code and should ensure that the submitted model and the written evidence submission match. A number typed inside a formula escapes a check of the report's input table against the model's input sheet, so the two can disagree without either showing it. Section 4.6.4 asks companies to detail the quality assurance methods used in developing the model, and section 5.5.11 says NICE sends the submission to the External Assessment Group for review. A search of the calculation sheets for numeric constants is a simple way to flag such a value.

    Source: NICE PMG36 (2022, updated 2026)

  • Does removing every hard-coded value make a health economic model correct?

    A model free of typed constants can be checked, yet it can still be wrong. Eddy and colleagues, for the ISPOR-SMDM task force, note that verification helps ensure there are no unintentional computational errors but does not evaluate the accuracy of a model's structure or predictions. A correctly linked but wrong input therefore still gives a wrong answer. The TECH-VER checklist gives no verification score because a score might give a false sense of security, so a finding of no hard-coded values is one logged item in technical verification, read alongside validation against data and other models.

    Source: Eddy et al. 2012

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 12 Nov 2026

Content version: 1.0.0

Canonical Identity

Term code
HE-EM-MV-110

Stable URI · Machine-readable · Resolvable · CC BY 4.0

This article is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).

Author: Dr Darrin Baines · Publisher: Intelligent Parameters Ltd · Identifier: https://healtheconomics.wiki/concept/hard-coded-value