Why Document a Specification?
A regression formula is a compact statement of which patterns a model is intended to represent. By itself, however, a formula does not explain why its terms belong there. A record of those reasons makes the specification easier to review: another analyst can see how each term relates to the question, what role it plays, and why plausible alternatives were left out.
This matters whether the goal is to describe an adjusted association or to make predictions. A variable may be recorded but unsuitable for the intended use; a scientifically important term may be retained even if it adds complexity; and two different terms can represent different accounts of how an outcome is related to predictors. Documentation keeps these choices visible rather than leaving them to be reconstructed from a final formula.
A term is a component of the formula, such as a predictor, a squared predictor, or an interaction. A variable is something measured or recorded. One variable can generate more than one possible term: for example, a model might use hours of practice as a linear term, include a squared-hours term to represent curvature, or include an interaction with a second predictor. The record should identify the term precisely enough that these choices are not blurred together.
What a Useful Record Contains
Start with the question and intended use, then list terms and exclusions. A useful record typically notes the outcome, the population or setting of interest, the time at which predictions would be made if forecasting is the goal, and the role of each term. Roles might include a primary predictor of interest, a planned adjustment variable, or a predictor available for forecasting. These labels describe why the term is present; they do not establish that an estimated coefficient will be large or statistically distinguishable from zero.
For each exclusion, name the variable or alternative term and give a reason connected to the question or intended use. Reasons might include that a measurement is unavailable at the forecast time, does not represent the proposed scientific mechanism, duplicates another representation, is an identifier rather than a generalizable predictor, or would make the model too complex for the available sample or planned use. “It was not significant” is not a sound prespecified rationale when the decision is supposed to be based on the question rather than observed associations.
Here is a compact form. It is a working record, not a claim that the proposed model is correct in every respect.
- Question and intended use: What outcome and population are being considered? Is the aim explanatory or predictive?
- Proposed model: State the outcome and all proposed terms.
- Included terms: For each, give its rationale and role.
- Excluded possibilities: Name plausible alternative terms and recorded variables, with a specific reason for exclusion.
- Scope and review: State relevant timing, data limitations, and what new evidence or change in purpose would prompt reconsideration.
The record should be specific, but it need not be long. “Include weather because it may help forecast demand” is weaker than “include the weather forecast issued by 6 p.m. because it is available when the next-day demand forecast is produced and is expected to be related to energy demand.” The second statement identifies the information, timing, and practical role.
Worked Specification Records
Worked Example: Forecasting Next-Day Energy Demand
Hypothetical setting. A utility has 180 weekdays of records. It wants to forecast the next day’s electricity demand, measured in megawatt-hours (MWh), by 6 p.m. on the preceding day. A forecaster has the calendar and the weather forecast issued by that time. The proposed model is a working linear regression for next-day demand \(Y_i\):
Here \(T_i^{\mathrm{forecast}}\) is the forecast high temperature in degrees Celsius, \(H_i^{\mathrm{forecast}}\) is forecast humidity as a percentage, and \(I_i^{\mathrm{weekend}}\) indicates whether the target day is a weekend. The model is a proposed mean structure, not an estimated result. Its forecast use assumes these predictors are available by the stated forecast time, and its regression formulation assumes the conditional mean can be usefully represented by the stated terms. Those assumptions would need later assessment; documenting a rationale does not verify them.
| Term or variable | Decision and role | Rationale |
|---|---|---|
| Forecast high temperature | Include; practical forecast predictor | Weather conditions may be related to electricity use, and this forecast is available by 6 p.m. |
| Forecast humidity | Include; practical forecast predictor | It is available at forecast time and may represent a weather condition associated with demand. |
| Weekend indicator | Include; calendar predictor | Demand patterns may differ between weekdays and weekends; the calendar is known in advance. |
| Realized next-day temperature | Exclude; recorded after forecast time | It is unavailable when the forecast is made. Using it would not produce the intended operational forecast. |
| Substation meter ID | Exclude; identifier | It labels a measurement source rather than a generalizable next-day condition. The target is system-level demand. |
| Temperature squared | Do not include in this initial specification | It is a plausible curvature term, but this initial record specifies a linear temperature contribution. Consider it if the scientific account or later assessment supports curvature. |
This record does not claim that the linear temperature relationship is known to be correct. It makes clear what “temperature” means operationally, why the usable forecast is included, and why the subsequently observed temperature is excluded. If the forecast horizon or information available to the forecaster changes, the exclusion rationale must be revisited.
Worked Example: Describing Wage Differences
Hypothetical setting. An analyst has records for 240 employees at one organization and asks how hourly wage, in dollars per hour, is associated with education after accounting for work experience and job category. The intended claim is descriptive of adjusted associations among these employees, not a causal effect of additional education. Let \(Y_i\) be hourly wage, \(E_i\) years of education, \(X_i\) years of relevant work experience, and \(J_i\) job category. A proposed model is:
The job-category terms represent differences among categories relative to a reference category. The proposed conditional-mean description assumes these additive terms are an adequate starting representation; it does not assert that the data satisfy every condition needed for a particular inferential conclusion.
| Term or variable | Decision and role | Rationale |
|---|---|---|
| Years of education | Include; primary predictor of interest | The question concerns the wage association with education, conditional on the stated adjustment terms. |
| Years of relevant experience | Include; planned adjustment term | Experience is a distinct work-history measure relevant to wage differences and is named in the question. |
| Job category | Include; planned adjustment terms | The question asks about the education association accounting for job category, so category differences are represented explicitly. |
| Employee ID | Exclude; identifier | The code distinguishes employees but has no proposed generalizable interpretation as a predictor. |
| Most recent performance rating | Exclude from this specification | The question does not define an association adjusted for this rating, and the rating may reflect job-specific evaluation processes. Its role would need a separate scientific justification. |
| Education-by-job-category interaction | Exclude from the initial specification | The stated question asks for a common education association across categories. A varying association is a different question and would need justification. |
The meaning of \(\beta_1\) depends on this specification: it describes the model’s education association at fixed experience and job category, under the proposed form. For comparison, a model with education alone describes a different conditional mean and does not answer the same adjusted question. Formally, the target functions differ:
Thus, writing down the adjustment set is not clerical detail. It tells readers what association is being described. The record also avoids turning the coefficient into a causal statement: the model and its documentation alone do not show that changing education would change an employee’s wage.
Worked Example: Modeling Appointment Wait Time
Hypothetical setting. A clinic records appointment wait time in minutes for 320 visits. Its planning question is whether staffing and appointment load are associated with waits during the clinic’s normal schedule. The initial model uses staffing level, number of appointments scheduled in the relevant session, and daypart (morning or afternoon). These variables are available before the session begins.
Here \(Y_i\) is wait time in minutes, \(S_i\) is the number of staff assigned to the session, \(A_i\) is the number of appointments scheduled, and \(I_i^{\mathrm{afternoon}}\) indicates an afternoon session. This specification proposes additive contributions to the conditional mean. It assumes the listed measurements are defined consistently and that this form is a reasonable initial representation, assumptions that would require evaluation before drawing substantive conclusions.
| Term or variable | Decision and role | Rationale |
|---|---|---|
| Staff assigned to session | Include; operational predictor | Staffing is a planning input and may be associated with the clinic’s capacity to serve scheduled visits. |
| Appointments scheduled | Include; operational predictor | It measures planned session load and is known before the session begins. |
| Afternoon indicator | Include; time-of-day adjustment | Morning and afternoon sessions may differ in operating conditions; daypart is known in advance. |
| Actual service duration | Exclude from the planning model | It is realized during or after a visit and is not available when session staffing is planned. It may be useful for a different descriptive question. |
| Patient record number | Exclude; identifier | It identifies a record and is not a meaningful general-purpose predictor of wait time. |
| Patient age | Exclude from the initial specification | The stated planning question concerns session-level staffing and scheduled load. Age has no specified role in that planning decision; reconsider it if a clear mechanism or decision use is established. |
The exclusions are not claims that actual service duration or age can never be relevant. They state why those variables are outside this particular question and model purpose. If the clinic later changes its question to describe patient-level differences, or gains a decision reason to use age, it should update the specification record rather than silently changing the formula.
A Short Justification: Why Record the Question Before the Formula?
The rationale is part of the interpretation because a regression model describes an outcome conditional on its included predictors. If the aim is to describe the relationship between an outcome \(Y\) and a focal variable \(X\) while accounting for \(Z\), the intended conditional mean is \(E(Y\mid X,Z)\). Omitting \(Z\) instead targets \(E(Y\mid X)\). These are generally different quantities; they coincide only under additional conditions, such as when the conditional mean does not vary with \(Z\) after conditioning on \(X\).
This does not mean that every plausible variable must be included. Rather, the question determines what relationship the model is intended to represent, while the intended use and available information constrain what terms can serve that purpose. The record makes these decisions inspectable. It also separates two kinds of reasoning: a scientific or practical reason for proposing a term, and later evidence about how well the proposed form works. Neither a written rationale nor a fitted model by itself settles whether the specification is adequate.
Common Pitfalls
- Listing variables without giving their roles. “Temperature, calendar, and humidity” does not tell a reader whether a variable is a primary predictor, a planned adjustment, or unavailable at the intended prediction time. Name the role and connect it to the question.
- Calling an exclusion permanent. “Age is irrelevant” is broader than the evidence usually allows. State the reason relative to this question and note what change in purpose would prompt reconsideration.
- Using observed significance as the rationale. “Exclude it because its p-value was large” makes the decision depend on the observed results, not solely on the planned scientific or practical basis. Document that basis explicitly.
- Confusing recorded with usable. A variable can exist in the data but be unavailable when a forecast is made. For prediction, document when each predictor becomes available and ensure that timing matches the intended use.
- Writing a rationale that overstates what the model shows. A variable’s inclusion does not prove a mechanism, and an adjusted association is not automatically causal. Use wording that matches the question and design.
Check Your Understanding
Answer each question by referring to the purpose of a specification record.
- What three pieces of information should a record give for each included term?
- A forecasting model uses the realized value of a predictor that is only measured the following day. What should the record say about this choice?
- Why is “the variable had a large p-value” a weak prespecified reason for excluding a term?
- In an explanatory model, what does documenting the adjustment variables clarify about the target association?
- How should an analyst describe an excluded variable that might be relevant to a different scientific question?