Why Outputs Go Stale
A regression report may contain estimates, confidence intervals, sample sizes, diagnostic plots, and figures. These are trustworthy only if they correspond to the analysis the report claims to describe. If the data change but a table does not, or a figure is edited by hand after it is generated, the report can quietly combine results from different analysis states.
The practical goal is not to eliminate every deliberate editorial choice. It is to make the origin of each analysis-derived result clear, and to make it possible to rebuild that result from its recorded inputs. A table or figure should not depend on someone remembering which spreadsheet cell to update after a script changes.
A useful working principle is: edit the source, then regenerate the output. The source may be a script, an analysis document, a model object saved for reporting, or a carefully maintained data-to-report process. The generated table or figure is an output, not the place to make a lasting correction.
Give Every File a Clear Role
A predictable file structure reduces the chance that a report uses an old result simply because it was easy to find. The names and folders can differ across projects; what matters is that each file has one clear role and that generated results are distinguishable from inputs and source code.
- Raw data: preserve the received data in a designated location. Do not quietly replace or edit these files during routine analysis.
- Analysis code: store the scripts or documents that import data, define the analysis, and create outputs.
- Generated outputs: put tables and figures created by the analysis in a dedicated location. Treat them as replaceable products of the source, not as independent originals.
- Report source and rendered report: distinguish the editable source used to assemble the report from the final rendered document.
Avoid ambiguous names such as “final,” “final-new,” and “final-revised.” A reader should be able to identify the intended input and output without guessing. If an analysis has several versions or planned alternatives, label them by a meaningful version, date, or analysis name and record which one the report uses. Do not let a file named “latest” silently mean different things to different people.
Keep manual narrative editing separate from analysis-derived content. Explanatory prose may appropriately be written or revised by an author. But if the prose states a sample size or coefficient, that statement is still an analysis result and should be checked against the current output. If the result changes, update the appropriate source and regenerate or review the report so the prose does not retain an old number.
Connect Report Elements to Their Sources
For each table and figure, identify its generating source and the inputs that source uses. A compact record can include an output name, the script or report section that creates it, the data file used, and an analysis identifier or version. This record need not be elaborate: it should answer the practical question, “What would I run or update to recreate this item?”
Whenever possible, have the report include a generated table or figure from its designated output location rather than copying values or images into a separate file. If the report system can create an item directly from the current analysis object, that can make the connection even clearer. Whichever approach is used, the report should not depend on a second, unrecorded copy that someone must update by hand.
A record of the analysis specification and decisions is also useful: it makes clear which choices were intended and which outputs belong to them. That record complements, but does not replace, linking a specific output to the source that creates it.
Worked Example: Finding a Table That Was Not Updated
Consider a hypothetical report on a model of weekly clinic visits. Its report table lists an estimated coefficient of 1.8 additional visits per ten-minute increase in travel time and an analysis sample of 120 patients. A revised data file, intended for the current report, contains 126 eligible patients. The current analysis script creates a table showing an estimate of 1.5 visits per ten-minute increase and a sample size of 126. These numbers are illustrative, not results from a real study.
Trace the report item. The report’s table is a copied document rather than an included generated output. Its source record points to an earlier table file, while the current script writes to a different output location. Thus the report and current analysis do not share a direct output path.
Compare the reported values. The sample-size difference is \(126 - 120 = 6\) patients. The coefficient difference is \(1.8 - 1.5 = 0.3\) additional visits per ten-minute increase in travel time. Both differences show that the table does not represent the current analysis output; neither comparison alone establishes why the estimates differ.
Repair the workflow. Update the report source to include the table generated by the current script, or revise the table-generation process so the report uses that output directly. Then review the rendered report to confirm it shows \(n=126\) and the current estimate of 1.5 visits per ten-minute increase. Do not merely type those two numbers into the old table: that would leave the disconnected source problem in place.
Regeneration Checks That Provide Evidence
A regeneration check asks whether the recorded source can produce the output currently being used. The simplest practical check is to regenerate an output and compare it with the report’s included version. If they differ, investigate before deciding which version is correct. A difference may reflect stale output, an intentional change, or a process that does not create the same result every time.
File modification times can help locate suspicious files, but they are not proof of freshness. A file can have a recent timestamp because it was copied, while still containing old results. Conversely, a correct file can have an older timestamp if its inputs have not changed. Stronger evidence comes from recording the input and source versions, and comparing the regenerated content with the content used in the report.
A content hash is a compact fingerprint calculated from a file’s contents. If the hash of the current data file differs from the recorded hash, the file’s contents have changed, even if its name is unchanged. A source-control version identifier can similarly identify the code version. These checks establish whether inputs or code differ from those recorded; they do not by themselves prove that the analysis is correct or that the report includes the newest outputs.
Worked Example: Using a File Record to Check a Figure
Suppose a hypothetical report includes a figure of predicted clinic visits by travel time. The project record says the figure was generated from the file named clinic_data.csv with content fingerprint A17 and from the plotting script at version R42. The current data file has fingerprint B29, and the plotting script is now version R43. These labels are illustrative identifiers, not actual software output.
Check the recorded inputs. The current data fingerprint B29 differs from A17, and the current script version R43 differs from R42. Therefore at least the recorded data contents and script version are not the same as the ones associated with the report figure.
Interpret the check carefully. This does not show that the plotted pattern must change. The changes might be irrelevant to the figure, or they might alter its displayed values or appearance. It does show that the old figure cannot be certified as the output of the current data and script just from its file name or a recent timestamp.
Regenerate and compare. Run the designated figure-generating source using the current inputs, save the result in the designated output location, and compare it with the report figure. Review any difference, then update the report from the intended generated output. Record the input and source versions associated with the regenerated figure so its origin is clear.
A Practical Prevention Sequence
Use a consistent sequence whenever analysis code or data change. It makes the dependency from input to reported output explicit and reduces accidental mixtures of old and new results.
Note whether the change concerns data, analysis code, an analysis decision, or report wording. The distinction helps identify which outputs may need attention.
Use the project’s source record to identify tables and figures produced by the affected input or code. Do not assume that every output is unaffected simply because its file was not directly edited.
Write generated items to their expected locations. Avoid making a correction only in an exported image, word-processing table, or rendered report.
Check that the generated items are the ones included in the report. Investigate unexpected changes, and confirm that captions, units, sample descriptions, and nearby prose still agree with the current output.
Update the output record with the data and code versions used. This provides a reference for the next change and makes the current report’s provenance easier to inspect.
Worked Example: Repairing a Hand-Edited Figure
A hypothetical report displays a scatterplot with a fitted regression line. The generated figure is created by a script, but an analyst later opens an exported image and changes the vertical-axis label from “score” to “score, points.” The same edit is not made in the script. In a later regeneration, the figure returns with the old label. The report has two competing versions of the figure source.
Separate content from presentation. The axis label is part of the figure’s presentation, but it is still controlled by the figure-generating process. The exported image is not a reliable long-term source because the next regeneration can overwrite it.
Make the correction at its source. Change the axis-label instruction in the figure-generating script to “score, points,” then regenerate the figure. There is no numerical calculation to reconcile in this example: the correction concerns the label and its units.
Check the report version. Confirm the regenerated figure has the corrected label and that the report includes this regenerated file rather than a separate old copy. If the label change also requires clarifying the written description, update that report text and review it alongside the figure.
Common Mistakes and Why They Matter
- “The file is recent, so the results are current.” A timestamp can change when a file is copied or exported. Check its inputs and generating source, not just its date.
- “I only corrected the displayed table.” A direct edit may be overwritten and can leave the report inconsistent with the analysis. Correct the generating source and regenerate.
- “The file name is the same, so the contents are the same.” A data file can be replaced without changing its name. Record or compare content versions when freshness matters.
- “The regenerated figure looks similar, so it must be identical.” Visual similarity is not evidence that all labels, scales, or plotted values match. Compare the regenerated output and inspect details that matter for interpretation.
- “Every changed input requires changing every output.” Some outputs may not depend on the changed input. Use the recorded dependencies to identify what should be regenerated, then verify the result rather than guessing.
These habits matter because a polished report can still be internally inconsistent. A sample size in prose may disagree with a table; a figure may show a different analysis version from the coefficient summary; or a manual edit may conceal how the displayed item was produced. Traceable sources and regeneration checks reduce these risks, while leaving statistical interpretation and review essential.
Check Your Understanding
Answer each question using the practices described above.
- A report contains a coefficient table copied into a document. What information would help you trace the table to its current data and generating code?
- Why is a recent file-modification time not enough to establish that a figure is current?
- A data file keeps the same name but has a different content fingerprint. What does that establish, and what does it not establish about a report figure?
- An axis label was corrected directly in an exported image. Where should the correction be made to persist through regeneration?
- After a script changes, how can you identify which tables and figures need attention without assuming that every output depends on that script?