Part of the process of building a statistical model
In statistics, model specification is part of the process of building a statistical model: specification consists of selecting an appropriate functional form for the model and choosing which variables to include. For example, given personal income formula_1 together with years of schooling formula_2 and on-the-job experience formula_3, we might specify a functional relationship formula_4 as follows:
formula_5
where formula_6 is the unexplained error term that is supposed to comprise independent and identically distributed Gaussian variables. 
The statistician Sir David Cox has said, "How [the] translation from subject-matter problem to statistical model is done is often the most critical part of an analysis".
Specification error and bias.
Specification error occurs when the functional form or the choice of independent variables poorly represent relevant aspects of the true data-generating process. In particular, bias (the expected value of the difference of an estimated parameter and the true underlying value) occurs if an independent variable is correlated with the errors inherent in the underlying process. There are several different possible causes of specification error; some are listed below. 
Additionally, measurement errors may affect the independent variables: while this is not a specification error, it can create statistical bias.
Note that all models will have some specification error. Indeed, in statistics there is a common aphorism that "all models are wrong". In the words of Burnham &amp; Anderson, "Modeling is an art as well as a science and is directed toward finding a good approximating model ... as the basis for statistical inference".
Detection of misspecification.
The Ramsey RESET test can help test for specification error in regression analysis.
In the example given above relating personal income to schooling and job experience, if the assumptions of the model are correct, then the least squares estimates of the parameters formula_7 and formula_8 will be efficient and unbiased. Hence specification diagnostics usually involve testing the first to fourth moment of the residuals.
Model building.
Building a model involves finding a set of relationships to represent the process that is generating the data. This requires avoiding all the sources of misspecification mentioned above. 
One approach is to start with a model in general form that relies on a theoretical understanding of the data-generating process. Then the model can be fit to the data and checked for the various sources of misspecification, in a task called "statistical model validation". Theoretical understanding can then guide the modification of the model in such a way as to retain theoretical validity while removing the sources of misspecification. But if it proves impossible to find a theoretically acceptable specification that fits the data, the theoretical model may have to be rejected and replaced with another one. 
A quotation from Karl Popper is apposite here: "Whenever a theory appears to you as the only possible one, take this as a sign that you have neither understood the theory nor the problem which it was intended to solve".
Another approach to model building is to specify several different models as candidates, and then compare those candidate models to each other. The purpose of the comparison is to determine which candidate model is most appropriate for statistical inference. Common criteria for comparing models include the following: "R"2, Bayes factor, and the likelihood-ratio test together with its generalization relative likelihood. For more on this topic, see "statistical model selection".
See also.
 ;templatestyles src="Div col/styles.css"/ ;
Notes.
 ;templatestyles src="Reflist/styles.css" / ;