# Multiple Linear Regression Analysis

This chapter expands on the analysis of simple linear regression models and discusses the analysis of multiple linear regression models. A major portion of the results displayed in Weibull++ DOE folios are explained in this chapter because these results are associated with multiple linear regression. One of the applications of multiple linear regression models is Response Surface Methodology (RSM). RSM is a method used to locate the optimum value of the response and is one of the final stages of experimentation. It is discussed in Response Surface Methods. Towards the end of this chapter, the concept of using indicator variables in regression models is explained. Indicator variables are used to represent qualitative factors in regression models. The concept of using indicator variables is important to gain an understanding of ANOVA models, which are the models used to analyze data obtained from experiments. These models can be thought of as first order multiple linear regression models where all the factors are treated as qualitative factors. ANOVA models are discussed in the One Factor Designs and General Full Factorial Designs chapters.

## Multiple Linear Regression Model

A linear regression model that contains more than one predictor variable is called a multiple linear regression model. The following model is a multiple linear regression model with two predictor variables, ${\displaystyle {{x}_{1}}\,\!}$ and ${\displaystyle {{x}_{2}}\,\!}$.

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+\epsilon \,\!}$

The model is linear because it is linear in the parameters ${\displaystyle {{\beta }_{0}}\,\!}$, ${\displaystyle {{\beta }_{1}}\,\!}$ and ${\displaystyle {{\beta }_{2}}\,\!}$. The model describes a plane in the three-dimensional space of ${\displaystyle Y\,\!}$, ${\displaystyle {{x}_{1}}\,\!}$ and ${\displaystyle {{x}_{2}}\,\!}$. The parameter ${\displaystyle {{\beta }_{0}}\,\!}$ is the intercept of this plane. Parameters ${\displaystyle {{\beta }_{1}}\,\!}$ and ${\displaystyle {{\beta }_{2}}\,\!}$ are referred to as partial regression coefficients. Parameter ${\displaystyle {{\beta }_{1}}\,\!}$ represents the change in the mean response corresponding to a unit change in ${\displaystyle {{x}_{1}}\,\!}$ when ${\displaystyle {{x}_{2}}\,\!}$ is held constant. Parameter ${\displaystyle {{\beta }_{2}}\,\!}$ represents the change in the mean response corresponding to a unit change in ${\displaystyle {{x}_{2}}\,\!}$ when ${\displaystyle {{x}_{1}}\,\!}$ is held constant. Consider the following example of a multiple linear regression model with two predictor variables, ${\displaystyle {{x}_{1}}\,\!}$ and ${\displaystyle {{x}_{2}}\,\!}$ :

${\displaystyle Y=30+5{{x}_{1}}+7{{x}_{2}}+\epsilon \,\!}$

This regression model is a first order multiple linear regression model. This is because the maximum power of the variables in the model is 1. (The regression plane corresponding to this model is shown in the figure below.) Also shown is an observed data point and the corresponding random error, ${\displaystyle \epsilon \,\!}$. The true regression model is usually never known (and therefore the values of the random error terms corresponding to observed data points remain unknown). However, the regression model can be estimated by calculating the parameters of the model for an observed data set. This is explained in Estimating Regression Models Using Least Squares.

One of the following figures shows the contour plot for the regression model the above equation. The contour plot shows lines of constant mean response values as a function of ${\displaystyle {{x}_{1}}\,\!}$ and ${\displaystyle {{x}_{2}}\,\!}$. The contour lines for the given regression model are straight lines as seen on the plot. Straight contour lines result for first order regression models with no interaction terms.

A linear regression model may also take the following form:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+{{\beta }_{12}}{{x}_{1}}{{x}_{2}}+\epsilon \,\!}$

A cross-product term, ${\displaystyle {{x}_{1}}{{x}_{2}}\,\!}$, is included in the model. This term represents an interaction effect between the two variables ${\displaystyle {{x}_{1}}\,\!}$ and ${\displaystyle {{x}_{2}}\,\!}$. Interaction means that the effect produced by a change in the predictor variable on the response depends on the level of the other predictor variable(s). As an example of a linear regression model with interaction, consider the model given by the equation ${\displaystyle Y=30+5{{x}_{1}}+7{{x}_{2}}+3{{x}_{1}}{{x}_{2}}+\epsilon \,\!}$. The regression plane and contour plot for this model are shown in the following two figures, respectively.

Now consider the regression model shown next:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}x_{1}^{2}+{{\beta }_{3}}x_{1}^{3}+\epsilon \,\!}$

This model is also a linear regression model and is referred to as a polynomial regression model. Polynomial regression models contain squared and higher order terms of the predictor variables making the response surface curvilinear. As an example of a polynomial regression model with an interaction term consider the following equation:

${\displaystyle Y=500+5{{x}_{1}}+7{{x}_{2}}-3x_{1}^{2}-5x_{2}^{2}+3{{x}_{1}}{{x}_{2}}+\epsilon \,\!}$

This model is a second order model because the maximum power of the terms in the model is two. The regression surface for this model is shown in the following figure. Such regression models are used in RSM to find the optimum value of the response, ${\displaystyle Y\,\!}$ (for details see Response Surface Methods for Optimization). Notice that, although the shape of the regression surface is curvilinear, the regression model is still linear because the model is linear in the parameters. The contour plot for this model is shown in the second of the following two figures.

All multiple linear regression models can be expressed in the following general form:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+...+{{\beta }_{k}}{{x}_{k}}+\epsilon \,\!}$

where ${\displaystyle k\,\!}$ denotes the number of terms in the model. For example, the model can be written in the general form using ${\displaystyle {{x}_{3}}=x_{1}^{2}\,\!}$, ${\displaystyle {{x}_{4}}=x_{2}^{3}\,\!}$ and ${\displaystyle {{x}_{5}}={{x}_{1}}{{x}_{2}}\,\!}$ as follows:

${\displaystyle Y=500+5{{x}_{1}}+7{{x}_{2}}-3{{x}_{3}}-5{{x}_{4}}+3{{x}_{5}}+\epsilon \,\!}$

## Estimating Regression Models Using Least Squares

Consider a multiple linear regression model with ${\displaystyle k\,\!}$ predictor variables:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+...+{{\beta }_{k}}{{x}_{k}}+\epsilon \,\!}$

Let each of the ${\displaystyle k\,\!}$ predictor variables, ${\displaystyle {{x}_{1}}\,\!}$, ${\displaystyle {{x}_{2}}\,\!}$... ${\displaystyle {{x}_{k}}\,\!}$, have ${\displaystyle n\,\!}$ levels. Then ${\displaystyle {{x}_{ij}}\,\!}$ represents the ${\displaystyle i\,\!}$ th level of the ${\displaystyle j\,\!}$ th predictor variable ${\displaystyle {{x}_{j}}\,\!}$. For example, ${\displaystyle {{x}_{51}}\,\!}$ represents the fifth level of the first predictor variable ${\displaystyle {{x}_{1}}\,\!}$, while ${\displaystyle {{x}_{19}}\,\!}$ represents the first level of the ninth predictor variable, ${\displaystyle {{x}_{9}}\,\!}$. Observations, ${\displaystyle {{y}_{1}}\,\!}$, ${\displaystyle {{y}_{2}}\,\!}$... ${\displaystyle {{y}_{n}}\,\!}$, recorded for each of these ${\displaystyle n\,\!}$ levels can be expressed in the following way:

{\displaystyle {\begin{aligned}{{y}_{1}}=&{{\beta }_{0}}+{{\beta }_{1}}{{x}_{11}}+{{\beta }_{2}}{{x}_{12}}+...+{{\beta }_{k}}{{x}_{1k}}+{{\epsilon }_{1}}\\{{y}_{2}}=&{{\beta }_{0}}+{{\beta }_{1}}{{x}_{21}}+{{\beta }_{2}}{{x}_{22}}+...+{{\beta }_{k}}{{x}_{2k}}+{{\epsilon }_{2}}\\&..\\{{y}_{i}}=&{{\beta }_{0}}+{{\beta }_{1}}{{x}_{i1}}+{{\beta }_{2}}{{x}_{i2}}+...+{{\beta }_{k}}{{x}_{ik}}+{{\epsilon }_{i}}\\&..\\{{y}_{n}}=&{{\beta }_{0}}+{{\beta }_{1}}{{x}_{n1}}+{{\beta }_{2}}{{x}_{n2}}+...+{{\beta }_{k}}{{x}_{nk}}+{{\epsilon }_{n}}\end{aligned}}\,\!}

The system of ${\displaystyle n\,\!}$ equations shown previously can be represented in matrix notation as follows:

${\displaystyle y=X\beta +\epsilon \,\!}$

where

${\displaystyle y=\left[{\begin{matrix}{{y}_{1}}\\{{y}_{2}}\\.\\.\\.\\{{y}_{n}}\\\end{matrix}}\right]{\text{ }}X=\left[{\begin{matrix}1&{{x}_{11}}&{{x}_{12}}&.&.&.&{{x}_{1n}}\\1&{{x}_{21}}&{{x}_{22}}&.&.&.&{{x}_{2n}}\\.&.&.&{}&{}&{}&.\\.&.&.&{}&{}&{}&.\\.&.&.&{}&{}&{}&.\\1&{{x}_{n1}}&{{x}_{n2}}&.&.&.&{{x}_{nn}}\\\end{matrix}}\right]\,\!}$

${\displaystyle \beta =\left[{\begin{matrix}{{\beta }_{0}}\\{{\beta }_{1}}\\.\\.\\.\\{{\beta }_{n}}\\\end{matrix}}\right]{\text{ and }}\epsilon =\left[{\begin{matrix}{{\epsilon }_{1}}\\{{\epsilon }_{2}}\\.\\.\\.\\{{\epsilon }_{n}}\\\end{matrix}}\right]\,\!}$

The matrix ${\displaystyle X\,\!}$ is referred to as the design matrix. It contains information about the levels of the predictor variables at which the observations are obtained. The vector ${\displaystyle \beta \,\!}$ contains all the regression coefficients. To obtain the regression model, ${\displaystyle \beta \,\!}$ should be known. ${\displaystyle \beta \,\!}$ is estimated using least square estimates. The following equation is used:

${\displaystyle {\hat {\beta }}={{({{X}^{\prime }}X)}^{-1}}{{X}^{\prime }}y\,\!}$

where ${\displaystyle ^{\prime }\,\!}$ represents the transpose of the matrix while ${\displaystyle ^{-1}\,\!}$ represents the matrix inverse. Knowing the estimates, ${\displaystyle {\hat {\beta }}\,\!}$, the multiple linear regression model can now be estimated as:

${\displaystyle {\hat {y}}=X{\hat {\beta }}\,\!}$

The estimated regression model is also referred to as the fitted model. The observations, ${\displaystyle {{y}_{i}}\,\!}$, may be different from the fitted values ${\displaystyle {{\hat {y}}_{i}}\,\!}$ obtained from this model. The difference between these two values is the residual, ${\displaystyle {{e}_{i}}\,\!}$. The vector of residuals, ${\displaystyle e\,\!}$, is obtained as:

${\displaystyle e=y-{\hat {y}}\,\!}$

The fitted model can also be written as follows, using ${\displaystyle {\hat {\beta }}={{({{X}^{\prime }}X)}^{-1}}{{X}^{\prime }}y\,\!}$:

{\displaystyle {\begin{aligned}{\hat {y}}&=&X{\hat {\beta }}\\&=&X{{({{X}^{\prime }}X)}^{-1}}{{X}^{\prime }}y\\&=&Hy\end{aligned}}\,\!}

where ${\displaystyle H=X{{({{X}^{\prime }}X)}^{-1}}{{X}^{\prime }}\,\!}$. The matrix, ${\displaystyle H\,\!}$, is referred to as the hat matrix. It transforms the vector of the observed response values, ${\displaystyle y\,\!}$, to the vector of fitted values, ${\displaystyle {\hat {y}}\,\!}$.

### Example

An analyst studying a chemical process expects the yield to be affected by the levels of two factors, ${\displaystyle {{x}_{1}}\,\!}$ and ${\displaystyle {{x}_{2}}\,\!}$. Observations recorded for various levels of the two factors are shown in the following table. The analyst wants to fit a first order regression model to the data. Interaction between ${\displaystyle {{x}_{1}}\,\!}$ and ${\displaystyle {{x}_{2}}\,\!}$ is not expected based on knowledge of similar processes. Units of the factor levels and the yield are ignored for the analysis.

The data of the above table can be entered into the Weibull++ DOE folio using the multiple linear regression folio tool as shown in the following figure.

A scatter plot for the data is shown next.

The first order regression model applicable to this data set having two predictor variables is:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+\epsilon \,\!}$

where the dependent variable, ${\displaystyle Y\,\!}$, represents the yield and the predictor variables, ${\displaystyle {{x}_{1}}\,\!}$ and ${\displaystyle {{x}_{2}}\,\!}$, represent the two factors respectively. The ${\displaystyle X\,\!}$ and ${\displaystyle y\,\!}$ matrices for the data can be obtained as:

${\displaystyle X=\left[{\begin{matrix}1&41.9&29.1\\1&43.4&29.3\\.&.&.\\.&.&.\\.&.&.\\1&77.8&32.9\\\end{matrix}}\right]{\text{ }}y=\left[{\begin{matrix}251.3\\251.3\\.\\.\\.\\349.0\\\end{matrix}}\right]\,\!}$

The least square estimates, ${\displaystyle {\hat {\beta }}\,\!}$, can now be obtained:

{\displaystyle {\begin{aligned}{\hat {\beta }}&=&{{({{X}^{\prime }}X)}^{-1}}{{X}^{\prime }}y\\&=&{{\left[{\begin{matrix}17&941&525.3\\941&54270&29286\\525.3&29286&16254\\\end{matrix}}\right]}^{-1}}\left[{\begin{matrix}4902.8\\276610\\152020\\\end{matrix}}\right]\\&=&\left[{\begin{matrix}-153.51\\1.24\\12.08\\\end{matrix}}\right]\end{aligned}}\,\!}

Thus:

${\displaystyle {\hat {\beta }}=\left[{\begin{matrix}{{\hat {\beta }}_{0}}\\{{\hat {\beta }}_{1}}\\{{\hat {\beta }}_{2}}\\\end{matrix}}\right]=\left[{\begin{matrix}-153.51\\1.24\\12.08\\\end{matrix}}\right]\,\!}$

and the estimated regression coefficients are ${\displaystyle {{\hat {\beta }}_{0}}=-153.51\,\!}$, ${\displaystyle {{\hat {\beta }}_{1}}=1.24\,\!}$ and ${\displaystyle {{\hat {\beta }}_{2}}=12.08\,\!}$. The fitted regression model is:

{\displaystyle {\begin{aligned}{\hat {y}}&=&{{\hat {\beta }}_{0}}+{{\hat {\beta }}_{1}}{{x}_{1}}+{{\hat {\beta }}_{2}}{{x}_{2}}\\&=&-153.5+1.24{{x}_{1}}+12.08{{x}_{2}}\end{aligned}}\,\!}

The fitted regression model can be viewed in the Weibull++ DOE folio, as shown next.

A plot of the fitted regression plane is shown in the following figure.

The fitted regression model can be used to obtain fitted values, ${\displaystyle {{\hat {y}}_{i}}\,\!}$, corresponding to an observed response value, ${\displaystyle {{y}_{i}}\,\!}$. For example, the fitted value corresponding to the fifth observation is:

{\displaystyle {\begin{aligned}{{\hat {y}}_{i}}&=&-153.5+1.24{{x}_{i1}}+12.08{{x}_{i2}}\\{{\hat {y}}_{5}}&=&-153.5+1.24{{x}_{51}}+12.08{{x}_{52}}\\&=&-153.5+1.24(47.3)+12.08(29.9)\\&=&266.3\end{aligned}}\,\!}

The observed fifth response value is ${\displaystyle {{y}_{5}}=273.0\,\!}$. The residual corresponding to this value is:

{\displaystyle {\begin{aligned}{{e}_{i}}&=&{{y}_{i}}-{{\hat {y}}_{i}}\\{{e}_{5}}&=&{{y}_{5}}-{{\hat {y}}_{5}}\\&=&273.0-266.3\\&=&6.7\end{aligned}}\,\!}

In Weibull++ DOE folios, fitted values and residuals are shown in the Diagnostic Information table of the detailed summary of results. The values are shown in the following figure.

The fitted regression model can also be used to predict response values. For example, to obtain the response value for a new observation corresponding to 47 units of ${\displaystyle {{x}_{1}}\,\!}$ and 31 units of ${\displaystyle {{x}_{2}}\,\!}$, the value is calculated using:

{\displaystyle {\begin{aligned}{\hat {y}}(47,31)&=&-153.5+1.24(47)+12.08(31)\\&=&279.26\end{aligned}}\,\!}

### Properties of the Least Square Estimators for Beta

The least square estimates, ${\displaystyle {{\hat {\beta }}_{0}}\,\!}$, ${\displaystyle {{\hat {\beta }}_{1}}\,\!}$, ${\displaystyle {{\hat {\beta }}_{2}}\,\!}$... ${\displaystyle {{\hat {\beta }}_{k}}\,\!}$, are unbiased estimators of ${\displaystyle {{\beta }_{0}}\,\!}$, ${\displaystyle {{\beta }_{1}}\,\!}$, ${\displaystyle {{\beta }_{2}}\,\!}$... ${\displaystyle {{\beta }_{k}}\,\!}$, provided that the random error terms, ${\displaystyle {{\epsilon }_{i}}\,\!}$, are normally and independently distributed. The variances of the ${\displaystyle {\hat {\beta }}\,\!}$ s are obtained using the ${\displaystyle {{({{X}^{\prime }}X)}^{-1}}\,\!}$ matrix. The variance-covariance matrix of the estimated regression coefficients is obtained as follows:

${\displaystyle C={{\hat {\sigma }}^{2}}{{({{X}^{\prime }}X)}^{-1}}\,\!}$

${\displaystyle C\,\!}$ is a symmetric matrix whose diagonal elements, ${\displaystyle {{C}_{jj}}\,\!}$, represent the variance of the estimated ${\displaystyle j\,\!}$ th regression coefficient, ${\displaystyle {{\hat {\beta }}_{j}}\,\!}$. The off-diagonal elements, ${\displaystyle {{C}_{ij}}\,\!}$, represent the covariance between the ${\displaystyle i\,\!}$ th and ${\displaystyle j\,\!}$ th estimated regression coefficients, ${\displaystyle {{\hat {\beta }}_{i}}\,\!}$ and ${\displaystyle {{\hat {\beta }}_{j}}\,\!}$. The value of ${\displaystyle {{\hat {\sigma }}^{2}}\,\!}$ is obtained using the error mean square, ${\displaystyle M{{S}_{E}}\,\!}$. The variance-covariance matrix for the data in the table (see Estimating Regression Models Using Least Squares) can be viewed in the DOE folio, as shown next.

Calculations to obtain the matrix are given in this example. The positive square root of ${\displaystyle {{C}_{jj}}\,\!}$ represents the estimated standard deviation of the ${\displaystyle j\,\!}$ th regression coefficient, ${\displaystyle {{\hat {\beta }}_{j}}\,\!}$, and is called the estimated standard error of ${\displaystyle {{\hat {\beta }}_{j}}\,\!}$ (abbreviated ${\displaystyle se({{\hat {\beta }}_{j}})\,\!}$ ).

${\displaystyle se({{\hat {\beta }}_{j}})={\sqrt {{C}_{jj}}}\,\!}$

## Hypothesis Tests in Multiple Linear Regression

This section discusses hypothesis tests on the regression coefficients in multiple linear regression. As in the case of simple linear regression, these tests can only be carried out if it can be assumed that the random error terms, ${\displaystyle {{\epsilon }_{i}}\,\!}$, are normally and independently distributed with a mean of zero and variance of ${\displaystyle {{\sigma }^{2}}\,\!}$. Three types of hypothesis tests can be carried out for multiple linear regression models:

1. Test for significance of regression: This test checks the significance of the whole regression model.
2. ${\displaystyle t\,\!}$ test: This test checks the significance of individual regression coefficients.
3. ${\displaystyle F\,\!}$ test: This test can be used to simultaneously check the significance of a number of regression coefficients. It can also be used to test individual coefficients.

### Test for Significance of Regression

The test for significance of regression in the case of multiple linear regression analysis is carried out using the analysis of variance. The test is used to check if a linear statistical relationship exists between the response variable and at least one of the predictor variables. The statements for the hypotheses are:

{\displaystyle {\begin{aligned}&{{H}_{0}}:&{{\beta }_{1}}={{\beta }_{2}}=...={{\beta }_{k}}=0\\&{{H}_{1}}:&{{\beta }_{j}}\neq 0{\text{ for at least one }}j\end{aligned}}\,\!}

The test for ${\displaystyle {{H}_{0}}\,\!}$ is carried out using the following statistic:

${\displaystyle {{F}_{0}}={\frac {M{{S}_{R}}}{M{{S}_{E}}}}\,\!}$

where ${\displaystyle M{{S}_{R}}\,\!}$ is the regression mean square and ${\displaystyle M{{S}_{E}}\,\!}$ is the error mean square. If the null hypothesis, ${\displaystyle {{H}_{0}}\,\!}$, is true then the statistic ${\displaystyle {{F}_{0}}\,\!}$ follows the ${\displaystyle F\,\!}$ distribution with ${\displaystyle k\,\!}$ degrees of freedom in the numerator and ${\displaystyle n-\,\!}$ ( ${\displaystyle k+1\,\!}$ ) degrees of freedom in the denominator. The null hypothesis, ${\displaystyle {{H}_{0}}\,\!}$, is rejected if the calculated statistic, ${\displaystyle {{F}_{0}}\,\!}$, is such that:

${\displaystyle {{F}_{0}}>{{f}_{\alpha ,k,n-(k+1)}}\,\!}$

#### Calculation of the Statistic ${\displaystyle {{F}_{0}}\,\!}$

To calculate the statistic ${\displaystyle {{F}_{0}}\,\!}$, the mean squares ${\displaystyle M{{S}_{R}}\,\!}$ and ${\displaystyle M{{S}_{E}}\,\!}$ must be known. As explained in Simple Linear Regression Analysis, the mean squares are obtained by dividing the sum of squares by their degrees of freedom. For example, the total mean square, ${\displaystyle M{{S}_{T}}\,\!}$, is obtained as follows:

${\displaystyle M{{S}_{T}}={\frac {S{{S}_{T}}}{dof(S{{S}_{T}})}}\,\!}$

where ${\displaystyle S{{S}_{T}}\,\!}$ is the total sum of squares and ${\displaystyle dof(S{{S}_{T}})\,\!}$ is the number of degrees of freedom associated with ${\displaystyle S{{S}_{T}}\,\!}$. In multiple linear regression, the following equation is used to calculate ${\displaystyle S{{S}_{T}}\,\!}$ :

${\displaystyle S{{S}_{T}}={{y}^{\prime }}\left[I-({\frac {1}{n}})J\right]y\,\!}$

where ${\displaystyle n\,\!}$ is the total number of observations, ${\displaystyle y\,\!}$ is the vector of observations (that was defined in Estimating Regression Models Using Least Squares), ${\displaystyle I\,\!}$ is the identity matrix of order ${\displaystyle n\,\!}$ and ${\displaystyle J\,\!}$ represents an ${\displaystyle n\times n\,\!}$ square matrix of ones. The number of degrees of freedom associated with ${\displaystyle S{{S}_{T}}\,\!}$, ${\displaystyle dof(S{{S}_{T}})\,\!}$, is ( ${\displaystyle n-1\,\!}$ ). Knowing ${\displaystyle S{{S}_{T}}\,\!}$ and ${\displaystyle dof(S{{S}_{T}})\,\!}$ the total mean square, ${\displaystyle M{{S}_{T}}\,\!}$, can be calculated.

The regression mean square, ${\displaystyle M{{S}_{R}}\,\!}$, is obtained by dividing the regression sum of squares, ${\displaystyle S{{S}_{R}}\,\!}$, by the respective degrees of freedom, ${\displaystyle dof(S{{S}_{R}})\,\!}$, as follows:

${\displaystyle M{{S}_{R}}={\frac {S{{S}_{R}}}{dof(S{{S}_{R}})}}\,\!}$

The regression sum of squares, ${\displaystyle S{{S}_{R}}\,\!}$, is calculated using the following equation:

${\displaystyle S{{S}_{R}}={{y}^{\prime }}\left[H-({\frac {1}{n}})J\right]y\,\!}$

where ${\displaystyle n\,\!}$ is the total number of observations, ${\displaystyle y\,\!}$ is the vector of observations, ${\displaystyle H\,\!}$ is the hat matrix and ${\displaystyle J\,\!}$ represents an ${\displaystyle n\times n\,\!}$ square matrix of ones. The number of degrees of freedom associated with ${\displaystyle S{{S}_{R}}\,\!}$, ${\displaystyle dof(S{{S}_{E}})\,\!}$, is ${\displaystyle k\,\!}$, where ${\displaystyle k\,\!}$ is the number of predictor variables in the model. Knowing ${\displaystyle S{{S}_{R}}\,\!}$ and ${\displaystyle dof(S{{S}_{R}})\,\!}$ the regression mean square, ${\displaystyle M{{S}_{R}}\,\!}$, can be calculated. The error mean square, ${\displaystyle M{{S}_{E}}\,\!}$, is obtained by dividing the error sum of squares, ${\displaystyle S{{S}_{E}}\,\!}$, by the respective degrees of freedom, ${\displaystyle dof(S{{S}_{E}})\,\!}$, as follows:

${\displaystyle M{{S}_{E}}={\frac {S{{S}_{E}}}{dof(S{{S}_{E}})}}\,\!}$

The error sum of squares, ${\displaystyle S{{S}_{E}}\,\!}$, is calculated using the following equation:

${\displaystyle S{{S}_{E}}={{y}^{\prime }}(I-H)y\,\!}$

where ${\displaystyle y\,\!}$ is the vector of observations, ${\displaystyle I\,\!}$ is the identity matrix of order ${\displaystyle n\,\!}$ and ${\displaystyle H\,\!}$ is the hat matrix. The number of degrees of freedom associated with ${\displaystyle S{{S}_{E}}\,\!}$, ${\displaystyle dof(S{{S}_{E}})\,\!}$, is ${\displaystyle n-(k+1)\,\!}$, where ${\displaystyle n\,\!}$ is the total number of observations and ${\displaystyle k\,\!}$ is the number of predictor variables in the model. Knowing ${\displaystyle S{{S}_{E}}\,\!}$ and ${\displaystyle dof(S{{S}_{E}})\,\!}$, the error mean square, ${\displaystyle M{{S}_{E}}\,\!}$, can be calculated. The error mean square is an estimate of the variance, ${\displaystyle {{\sigma }^{2}}\,\!}$, of the random error terms, ${\displaystyle {{\epsilon }_{i}}\,\!}$.

${\displaystyle {{\hat {\sigma }}^{2}}=M{{S}_{E}}\,\!}$
##### Example

The test for the significance of regression, for the regression model obtained for the data in the table (see Estimating Regression Models Using Least Squares), is illustrated in this example. The null hypothesis for the model is:

${\displaystyle {{H}_{0}}:{{\beta }_{1}}={{\beta }_{2}}=0\,\!}$

The statistic to test ${\displaystyle {{H}_{0}}\,\!}$ is:

${\displaystyle {{F}_{0}}={\frac {M{{S}_{R}}}{M{{S}_{E}}}}\,\!}$

To calculate ${\displaystyle {{F}_{0}}\,\!}$, first the sum of squares are calculated so that the mean squares can be obtained. Then the mean squares are used to calculate the statistic ${\displaystyle {{F}_{0}}\,\!}$ to carry out the significance test. The regression sum of squares, ${\displaystyle S{{S}_{R}}\,\!}$, can be obtained as:

${\displaystyle S{{S}_{R}}={{y}^{\prime }}\left[H-({\frac {1}{n}})J\right]y\,\!}$

The hat matrix, ${\displaystyle H\,\!}$ is calculated as follows using the design matrix ${\displaystyle X\,\!}$ from the previous example:

{\displaystyle {\begin{aligned}H&=&X{{({{X}^{\prime }}X)}^{-1}}{{X}^{\prime }}\\&=&\left[{\begin{matrix}0.27552&0.25154&.&.&-0.04030\\0.25154&0.23021&.&.&-0.029120\\.&.&.&.&.\\.&.&.&.&.\\-0.04030&-0.02920&.&.&0.30115\\\end{matrix}}\right]\end{aligned}}\,\!}

Knowing ${\displaystyle y\,\!}$, ${\displaystyle H\,\!}$ and ${\displaystyle J\,\!}$, the regression sum of squares, ${\displaystyle S{{S}_{R}}\,\!}$, can be calculated:

{\displaystyle {\begin{aligned}S{{S}_{R}}&=&{{y}^{\prime }}\left[H-({\frac {1}{n}})J\right]y\\&=&12816.35\end{aligned}}\,\!}

The degrees of freedom associated with ${\displaystyle S{{S}_{R}}\,\!}$ is ${\displaystyle k\,\!}$, which equals to a value of two since there are two predictor variables in the data in the table (see Multiple Linear Regression Analysis). Therefore, the regression mean square is:

{\displaystyle {\begin{aligned}M{{S}_{R}}&=&{\frac {S{{S}_{R}}}{dof(S{{S}_{R}})}}\\&=&{\frac {12816.35}{2}}\\&=&6408.17\end{aligned}}\,\!}

Similarly to calculate the error mean square, ${\displaystyle M{{S}_{E}}\,\!}$, the error sum of squares, ${\displaystyle S{{S}_{E}}\,\!}$, can be obtained as:

{\displaystyle {\begin{aligned}S{{S}_{E}}&=&{{y}^{\prime }}\left[I-H\right]y\\&=&423.37\end{aligned}}\,\!}

The degrees of freedom associated with ${\displaystyle S{{S}_{E}}\,\!}$ is ${\displaystyle n-(k+1)\,\!}$. Therefore, the error mean square, ${\displaystyle M{{S}_{E}}\,\!}$, is:

{\displaystyle {\begin{aligned}M{{S}_{E}}&=&{\frac {S{{S}_{E}}}{dof(S{{S}_{E}})}}\\&=&{\frac {S{{S}_{E}}}{(n-(k+1))}}\\&=&{\frac {423.37}{(17-(2+1))}}\\&=&30.24\end{aligned}}\,\!}

The statistic to test the significance of regression can now be calculated as:

{\displaystyle {\begin{aligned}{{f}_{0}}&=&{\frac {M{{S}_{R}}}{M{{S}_{E}}}}\\&=&{\frac {6408.17}{423.37/(17-3)}}\\&=&211.9\end{aligned}}\,\!}

The critical value for this test, corresponding to a significance level of 0.1, is:

{\displaystyle {\begin{aligned}{{f}_{\alpha ,k,n-(k+1)}}&=&{{f}_{0.1,2,14}}\\&=&2.726\end{aligned}}\,\!}

Since ${\displaystyle {{f}_{0}}>{{f}_{0.1,2,14}}\,\!}$, ${\displaystyle {{H}_{0}}:\,\!}$ ${\displaystyle {{\beta }_{1}}={{\beta }_{2}}=0\,\!}$ is rejected and it is concluded that at least one coefficient out of ${\displaystyle {{\beta }_{1}}\,\!}$ and ${\displaystyle {{\beta }_{2}}\,\!}$ is significant. In other words, it is concluded that a regression model exists between yield and either one or both of the factors in the table. The analysis of variance is summarized in the following table.

### Test on Individual Regression Coefficients (t Test)

The ${\displaystyle t\,\!}$ test is used to check the significance of individual regression coefficients in the multiple linear regression model. Adding a significant variable to a regression model makes the model more effective, while adding an unimportant variable may make the model worse. The hypothesis statements to test the significance of a particular regression coefficient, ${\displaystyle {{\beta }_{j}}\,\!}$, are:

{\displaystyle {\begin{aligned}&{{H}_{0}}:&{{\beta }_{j}}=0\\&{{H}_{1}}:&{{\beta }_{j}}\neq 0\end{aligned}}\,\!}

The test statistic for this test is based on the ${\displaystyle t\,\!}$ distribution (and is similar to the one used in the case of simple linear regression models in Simple Linear Regression Anaysis):

${\displaystyle {{T}_{0}}={\frac {{\hat {\beta }}_{j}}{se({{\hat {\beta }}_{j}})}}\,\!}$

where the standard error, ${\displaystyle se({{\hat {\beta }}_{j}})\,\!}$, is obtained. The analyst would fail to reject the null hypothesis if the test statistic lies in the acceptance region:

${\displaystyle -{{t}_{\alpha /2,n-2}}<{{T}_{0}}<{{t}_{\alpha /2,n-2}}\,\!}$

This test measures the contribution of a variable while the remaining variables are included in the model. For the model ${\displaystyle {\hat {y}}={{\hat {\beta }}_{0}}+{{\hat {\beta }}_{1}}{{x}_{1}}+{{\hat {\beta }}_{2}}{{x}_{2}}+{{\hat {\beta }}_{3}}{{x}_{3}}\,\!}$, if the test is carried out for ${\displaystyle {{\beta }_{1}}\,\!}$, then the test will check the significance of including the variable ${\displaystyle {{x}_{1}}\,\!}$ in the model that contains ${\displaystyle {{x}_{2}}\,\!}$ and ${\displaystyle {{x}_{3}}\,\!}$ (i.e., the model ${\displaystyle {\hat {y}}={{\hat {\beta }}_{0}}+{{\hat {\beta }}_{2}}{{x}_{2}}+{{\hat {\beta }}_{3}}{{x}_{3}}\,\!}$ ). Hence the test is also referred to as partial or marginal test. In DOE folios, this test is displayed in the Regression Information table.

#### Example

The test to check the significance of the estimated regression coefficients for the data is illustrated in this example. The null hypothesis to test the coefficient ${\displaystyle {{\beta }_{2}}\,\!}$ is:

${\displaystyle {{H}_{0}}:{{\beta }_{2}}=0\,\!}$

The null hypothesis to test ${\displaystyle {{\beta }_{1}}\,\!}$ can be obtained in a similar manner. To calculate the test statistic, ${\displaystyle {{T}_{0}}\,\!}$, we need to calculate the standard error. In the example, the value of the error mean square, ${\displaystyle M{{S}_{E}}\,\!}$, was obtained as 30.24. The error mean square is an estimate of the variance, ${\displaystyle {{\sigma }^{2}}\,\!}$.

Therefore:

{\displaystyle {\begin{aligned}{{\hat {\sigma }}^{2}}&=&M{{S}_{E}}\\&=&30.24\end{aligned}}\,\!}

The variance-covariance matrix of the estimated regression coefficients is:

{\displaystyle {\begin{aligned}C&=&{{\hat {\sigma }}^{2}}{{({{X}^{\prime }}X)}^{-1}}\\&=&30.24\left[{\begin{matrix}336.5&1.2&-13.1\\1.2&0.005&-0.049\\-13.1&-0.049&0.5\\\end{matrix}}\right]\\&=&\left[{\begin{matrix}10176.75&37.145&-395.83\\37.145&0.1557&-1.481\\-395.83&-1.481&15.463\\\end{matrix}}\right]\end{aligned}}\,\!}

From the diagonal elements of ${\displaystyle C\,\!}$, the estimated standard error for ${\displaystyle {{\hat {\beta }}_{1}}\,\!}$ and ${\displaystyle {{\hat {\beta }}_{2}}\,\!}$ is:

{\displaystyle {\begin{aligned}se({{\hat {\beta }}_{1}})&=&{\sqrt {0.1557}}=0.3946\\se({{\hat {\beta }}_{2}})&=&{\sqrt {15.463}}=3.93\end{aligned}}\,\!}

The corresponding test statistics for these coefficients are:

{\displaystyle {\begin{aligned}{{({{t}_{0}})}_{{\hat {\beta }}_{1}}}&=&{\frac {{\hat {\beta }}_{1}}{se({{\hat {\beta }}_{1}})}}={\frac {1.24}{0.3946}}=3.1393\\{{({{t}_{0}})}_{{\hat {\beta }}_{2}}}&=&{\frac {{\hat {\beta }}_{2}}{se({{\hat {\beta }}_{2}})}}={\frac {12.08}{3.93}}=3.0726\end{aligned}}\,\!}

The critical values for the present ${\displaystyle t\,\!}$ test at a significance of 0.1 are:

{\displaystyle {\begin{aligned}{{t}_{\alpha /2,n-(k+1)}}&=&{{t}_{0.05,14}}=1.761\\-{{t}_{\alpha /2,n-(k+1)}}&=&-{{t}_{0.05,14}}=-1.761\end{aligned}}\,\!}

Considering ${\displaystyle {{\hat {\beta }}_{2}}\,\!}$, it can be seen that ${\displaystyle {{({{t}_{0}})}_{{\hat {\beta }}_{2}}}\,\!}$ does not lie in the acceptance region of ${\displaystyle -{{t}_{0.05,14}}<{{t}_{0}}<{{t}_{0.05,14}}\,\!}$. The null hypothesis, ${\displaystyle {{H}_{0}}:{{\beta }_{2}}=0\,\!}$, is rejected and it is concluded that ${\displaystyle {{\beta }_{2}}\,\!}$ is significant at ${\displaystyle \alpha =0.1\,\!}$. This conclusion can also be arrived at using the ${\displaystyle p\,\!}$ value noting that the hypothesis is two-sided. The ${\displaystyle p\,\!}$ value corresponding to the test statistic, ${\displaystyle {{({{t}_{0}})}_{{\hat {\beta }}_{2}}}=3.0726\,\!}$, based on the ${\displaystyle t\,\!}$ distribution with 14 degrees of freedom is:

{\displaystyle {\begin{aligned}p{\text{ }}value&=&2\times (1-P(T\leq |{{t}_{0}}|)\\&=&2\times (1-0.9959)\\&=&0.0083\end{aligned}}\,\!}

Since the ${\displaystyle p\,\!}$ value is less than the significance, ${\displaystyle \alpha =0.1\,\!}$, it is concluded that ${\displaystyle {{\beta }_{2}}\,\!}$ is significant. The hypothesis test on ${\displaystyle {{\beta }_{1}}\,\!}$ can be carried out in a similar manner.

As explained in Simple Linear Regression Analysis, in DOE folios, the information related to the ${\displaystyle t\,\!}$ test is displayed in the Regression Information table as shown in the figure below.

In this table, the ${\displaystyle t\,\!}$ test for ${\displaystyle {{\beta }_{2}}\,\!}$ is displayed in the row for the term Factor 2 because ${\displaystyle {{\beta }_{2}}\,\!}$ is the coefficient that represents this factor in the regression model. Columns labeled Standard Error, T Value and P Value represent the standard error, the test statistic for the ${\displaystyle t\,\!}$ test and the ${\displaystyle p\,\!}$ value for the ${\displaystyle t\,\!}$ test, respectively. These values have been calculated for ${\displaystyle {{\beta }_{2}}\,\!}$ in this example. The Coefficient column represents the estimate of regression coefficients. These values are calculated as shown in this example. The Effect column represents values obtained by multiplying the coefficients by a factor of 2. This value is useful in the case of two factor experiments and is explained in Two-Level Factorial Experiments. Columns labeled Low Confidence and High Confidence represent the limits of the confidence intervals for the regression coefficients and are explained in Confidence Intervals in Multiple Linear Regression. The Variance Inflation Factor column displays values that give a measure of multicollinearity. This is explained in Multicollinearity.

### Test on Subsets of Regression Coefficients (Partial F Test)

This test can be considered to be the general form of the ${\displaystyle t\,\!}$ test mentioned in the previous section. This is because the test simultaneously checks the significance of including many (or even one) regression coefficients in the multiple linear regression model. Adding a variable to a model increases the regression sum of squares, ${\displaystyle S{{S}_{R}}\,\!}$. The test is based on this increase in the regression sum of squares. The increase in the regression sum of squares is called the extra sum of squares. Assume that the vector of the regression coefficients, ${\displaystyle \beta \,\!}$, for the multiple linear regression model, ${\displaystyle y=X\beta +\epsilon \,\!}$, is partitioned into two vectors with the second vector, ${\displaystyle {{\theta }_{2}}\,\!}$, containing the last ${\displaystyle r\,\!}$ regression coefficients, and the first vector, ${\displaystyle {{\theta }_{1}}\,\!}$, containing the first ( ${\displaystyle k+1-r\,\!}$ ) coefficients as follows:

${\displaystyle \beta =\left[{\begin{matrix}{{\theta }_{1}}\\{{\theta }_{2}}\\\end{matrix}}\right]\,\!}$

with:

${\displaystyle {{\theta }_{1}}=[{{\beta }_{0}},{{\beta }_{1}}...{{\beta }_{k-r}}{]}'{\text{ and }}{{\theta }_{2}}=[{{\beta }_{k-r+1}},{{\beta }_{k-r+2}}...{{\beta }_{k}}{]}'{\text{ }}\,\!}$

The hypothesis statements to test the significance of adding the regression coefficients in ${\displaystyle {{\theta }_{2}}\,\!}$ to a model containing the regression coefficients in ${\displaystyle {{\theta }_{1}}\,\!}$ may be written as:

{\displaystyle {\begin{aligned}&{{H}_{0}}:&{{\theta }_{2}}=0\\&{{H}_{1}}:&{{\theta }_{2}}\neq 0\end{aligned}}\,\!}

The test statistic for this test follows the ${\displaystyle F\,\!}$ distribution and can be calculated as follows:

${\displaystyle {{F}_{0}}={\frac {S{{S}_{R}}({{\theta }_{2}}|{{\theta }_{1}})/r}{M{{S}_{E}}}}\,\!}$

where ${\displaystyle S{{S}_{R}}({{\theta }_{2}}|{{\theta }_{1}})\,\!}$ is the the increase in the regression sum of squares when the variables corresponding to the coefficients in ${\displaystyle {{\theta }_{2}}\,\!}$ are added to a model already containing ${\displaystyle {{\theta }_{1}}\,\!}$, and ${\displaystyle M{{S}_{E}}\,\!}$ is obtained from the equation given in Simple Linear Regression Analysis. The value of the extra sum of squares is obtained as explained in the next section.

The null hypothesis, ${\displaystyle {{H}_{0}}\,\!}$, is rejected if ${\displaystyle {{F}_{0}}>{{f}_{\alpha ,r,n-(k+1)}}\,\!}$. Rejection of ${\displaystyle {{H}_{0}}\,\!}$ leads to the conclusion that at least one of the variables in ${\displaystyle {{x}_{k-r+1}}\,\!}$, ${\displaystyle {{x}_{k-r+2}}\,\!}$... ${\displaystyle {{x}_{k}}\,\!}$ contributes significantly to the regression model. In a DOE folio, the results from the partial ${\displaystyle F\,\!}$ test are displayed in the ANOVA table.

### Types of Extra Sum of Squares

The extra sum of squares can be calculated using either the partial (or adjusted) sum of squares or the sequential sum of squares. The type of extra sum of squares used affects the calculation of the test statistic for the partial ${\displaystyle F\,\!}$ test described above. In DOE folios, selection for the type of extra sum of squares is available as shown in the figure below. The partial sum of squares is used as the default setting. The reason for this is explained in the following section on the partial sum of squares.

#### Partial Sum of Squares

The partial sum of squares for a term is the extra sum of squares when all terms, except the term under consideration, are included in the model. For example, consider the model:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+{{\beta }_{12}}{{x}_{1}}{{x}_{2}}+\epsilon \,\!}$

The sum of squares of regression of this model is denoted by ${\displaystyle S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}},{{\beta }_{2}},{{\beta }_{12}})\,\!}$. Assume that we need to know the partial sum of squares for ${\displaystyle {{\beta }_{2}}\,\!}$. The partial sum of squares for ${\displaystyle {{\beta }_{2}}\,\!}$ is the increase in the regression sum of squares when ${\displaystyle {{\beta }_{2}}\,\!}$ is added to the model. This increase is the difference in the regression sum of squares for the full model of the equation given above and the model that includes all terms except ${\displaystyle {{\beta }_{2}}\,\!}$. These terms are ${\displaystyle {{\beta }_{0}}\,\!}$, ${\displaystyle {{\beta }_{1}}\,\!}$ and ${\displaystyle {{\beta }_{12}}\,\!}$. The model that contains these terms is:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{12}}{{x}_{1}}{{x}_{2}}+\epsilon \,\!}$

The sum of squares of regression of this model is denoted by ${\displaystyle S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}},{{\beta }_{12}})\,\!}$. The partial sum of squares for ${\displaystyle {{\beta }_{2}}\,\!}$can be represented as ${\displaystyle S{{S}_{R}}({{\beta }_{2}}|{{\beta }_{0}},{{\beta }_{1}},{{\beta }_{12}})\,\!}$ and is calculated as follows:

{\displaystyle {\begin{aligned}S{{S}_{R}}({{\beta }_{2}}|{{\beta }_{0}},{{\beta }_{1}},{{\beta }_{12}})&=&S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}},{{\beta }_{2}},{{\beta }_{12}})-S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}},{{\beta }_{12}})\end{aligned}}\,\!}

For the present case, ${\displaystyle {{\theta }_{2}}=[{{\beta }_{2}}{]}'\,\!}$ and ${\displaystyle {{\theta }_{1}}=[{{\beta }_{0}},{{\beta }_{1}},{{\beta }_{12}}{]}'\,\!}$. It can be noted that for the partial sum of squares ${\displaystyle {{\beta }_{1}}\,\!}$ contains all coefficients other than the coefficient being tested.

A Weibull++ DOE folio has the partial sum of squares as the default selection. This is because the ${\displaystyle t\,\!}$ test is a partial test, i.e., the ${\displaystyle t\,\!}$ test on an individual coefficient is carried by assuming that all the remaining coefficients are included in the model (similar to the way the partial sum of squares is calculated). The results from the ${\displaystyle t\,\!}$ test are displayed in the Regression Information table. The results from the partial ${\displaystyle F\,\!}$ test are displayed in the ANOVA table. To keep the results in the two tables consistent with each other, the partial sum of squares is used as the default selection for the results displayed in the ANOVA table. The partial sum of squares for all terms of a model may not add up to the regression sum of squares for the full model when the regression coefficients are correlated. If it is preferred that the extra sum of squares for all terms in the model always add up to the regression sum of squares for the full model then the sequential sum of squares should be used.

##### Example

This example illustrates the ${\displaystyle F\,\!}$ test using the partial sum of squares. The test is conducted for the coefficient ${\displaystyle {{\beta }_{1}}\,\!}$ corresponding to the predictor variable ${\displaystyle {{x}_{1}}\,\!}$ for the data. The regression model used for this data set in the example is:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+\epsilon \,\!}$

The null hypothesis to test the significance of ${\displaystyle {{\beta }_{1}}\,\!}$ is:

${\displaystyle {{H}_{0}}:{{\beta }_{1}}=0\,\!}$

The statistic to test this hypothesis is:

${\displaystyle {{F}_{0}}={\frac {S{{S}_{R}}({{\beta }_{1}}|{{\beta }_{2}})/r}{M{{S}_{E}}}}\,\!}$

where ${\displaystyle S{{S}_{R}}({{\beta }_{1}}|{{\beta }_{2}})\,\!}$ represents the partial sum of squares for ${\displaystyle {{\beta }_{1}}\,\!}$, ${\displaystyle r\,\!}$ represents the number of degrees of freedom for ${\displaystyle S{{S}_{R}}({{\beta }_{1}}|{{\beta }_{2}})\,\!}$ (which is one because there is just one coefficient, ${\displaystyle {{\beta }_{1}}\,\!}$, being tested) and ${\displaystyle M{{S}_{E}}\,\!}$ is the error mean square and has been calculated in the second example as 30.24.

The partial sum of squares for ${\displaystyle {{\beta }_{1}}\,\!}$ is the difference between the regression sum of squares for the full model, ${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+\epsilon \,\!}$, and the regression sum of squares for the model excluding ${\displaystyle {{\beta }_{1}}\,\!}$, ${\displaystyle Y={{\beta }_{0}}+{{\beta }_{2}}{{x}_{2}}+\epsilon \,\!}$. The regression sum of squares for the full model has been calculated in the second example as 12816.35. Therefore:

${\displaystyle S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}},{{\beta }_{2}})=12816.35\,\!}$

The regression sum of squares for the model ${\displaystyle Y={{\beta }_{0}}+{{\beta }_{2}}{{x}_{2}}+\epsilon \,\!}$ is obtained as shown next. First the design matrix for this model, ${\displaystyle {{X}_{{{\beta }_{0}},{{\beta }_{2}}}}\,\!}$, is obtained by dropping the second column in the design matrix of the full model, ${\displaystyle X\,\!}$ (the full design matrix, ${\displaystyle X\,\!}$, was obtained in the example). The second column of ${\displaystyle X\,\!}$ corresponds to the coefficient ${\displaystyle {{\beta }_{1}}\,\!}$ which is no longer in the model. Therefore, the design matrix for the model, ${\displaystyle Y={{\beta }_{0}}+{{\beta }_{2}}{{x}_{2}}+\epsilon \,\!}$, is:

${\displaystyle {{X}_{{{\beta }_{0}},{{\beta }_{2}}}}=\left[{\begin{matrix}1&29.1\\1&29.3\\.&.\\.&.\\1&32.9\\\end{matrix}}\right]\,\!}$

The hat matrix corresponding to this design matrix is ${\displaystyle {{H}_{{{\beta }_{0}},{{\beta }_{2}}}}\,\!}$. It can be calculated using ${\displaystyle {{H}_{{{\beta }_{0}},{{\beta }_{2}}}}={{X}_{{{\beta }_{0}},{{\beta }_{2}}}}{{(X_{{{\beta }_{0}},{{\beta }_{2}}}^{\prime }{{X}_{{{\beta }_{0}},{{\beta }_{2}}}})}^{-1}}X_{{{\beta }_{0}},{{\beta }_{2}}}^{\prime }\,\!}$. Once ${\displaystyle {{H}_{{{\beta }_{0}},{{\beta }_{2}}}}\,\!}$ is known, the regression sum of squares for the model ${\displaystyle Y={{\beta }_{0}}+{{\beta }_{2}}{{x}_{2}}+\epsilon \,\!}$, can be calculated as:

{\displaystyle {\begin{aligned}S{{S}_{R}}({{\beta }_{0}},{{\beta }_{2}})&=&{{y}^{\prime }}\left[{{H}_{{{\beta }_{0}},{{\beta }_{2}}}}-({\frac {1}{n}})J\right]y\\&=&12518.32\end{aligned}}\,\!}

Therefore, the partial sum of squares for ${\displaystyle {{\beta }_{1}}\,\!}$ is:

{\displaystyle {\begin{aligned}S{{S}_{R}}({{\beta }_{1}}|{{\beta }_{2}})&=&S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}},{{\beta }_{2}})-S{{S}_{R}}({{\beta }_{0}},{{\beta }_{2}})\\&=&12816.35-12518.32\\&=&298.03\end{aligned}}\,\!}

Knowing the partial sum of squares, the statistic to test the significance of ${\displaystyle {{\beta }_{1}}\,\!}$ is:

{\displaystyle {\begin{aligned}{{f}_{0}}&=&{\frac {S{{S}_{R}}({{\beta }_{1}}|{{\beta }_{2}})/r}{M{{S}_{E}}}}\\&=&{\frac {298.03/1}{30.24}}\\&=&9.855\end{aligned}}\,\!}

The ${\displaystyle p\,\!}$ value corresponding to this statistic based on the ${\displaystyle F\,\!}$ distribution with 1 degree of freedom in the numerator and 14 degrees of freedom in the denominator is:

{\displaystyle {\begin{aligned}p{\text{ }}value&=&1-P(F\leq {{f}_{0}})\\&=&1-0.9928\\&=&0.0072\end{aligned}}\,\!}

Assuming that the desired significance is 0.1, since ${\displaystyle p\,\!}$ value < 0.1, ${\displaystyle {{H}_{0}}:{{\beta }_{1}}=0\,\!}$ is rejected and it can be concluded that ${\displaystyle {{\beta }_{1}}\,\!}$ is significant. The test for ${\displaystyle {{\beta }_{2}}\,\!}$ can be carried out in a similar manner. In the results obtained from the DOE folio, the calculations for this test are displayed in the ANOVA table as shown in the following figure. Note that the conclusion obtained in this example can also be obtained using the ${\displaystyle t\,\!}$ test as explained in the example in Test on Individual Regression Coefficients (t Test). The ANOVA and Regression Information tables in the DOE folio represent two different ways to test for the significance of the variables included in the multiple linear regression model.

#### Sequential Sum of Squares

The sequential sum of squares for a coefficient is the extra sum of squares when coefficients are added to the model in a sequence. For example, consider the model:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+{{\beta }_{12}}{{x}_{1}}{{x}_{2}}+{{\beta }_{3}}{{x}_{3}}+{{\beta }_{13}}{{x}_{1}}{{x}_{3}}+{{\beta }_{23}}{{x}_{2}}{{x}_{3}}+{{\beta }_{123}}{{x}_{1}}{{x}_{2}}{{x}_{3}}+\epsilon \,\!}$

The sequential sum of squares for ${\displaystyle {{\beta }_{13}}\,\!}$ is the increase in the sum of squares when ${\displaystyle {{\beta }_{13}}\,\!}$ is added to the model observing the sequence of the equation given above. Therefore this extra sum of squares can be obtained by taking the difference between the regression sum of squares for the model after ${\displaystyle {{\beta }_{13}}\,\!}$ was added and the regression sum of squares for the model before ${\displaystyle {{\beta }_{13}}\,\!}$ was added to the model. The model after ${\displaystyle {{\beta }_{13}}\,\!}$ is added is as follows:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+{{\beta }_{12}}{{x}_{1}}{{x}_{2}}+{{\beta }_{3}}{{x}_{3}}+{{\beta }_{13}}{{x}_{1}}{{x}_{3}}+\epsilon \,\!}$

This is because to maintain the sequence all coefficients preceding ${\displaystyle {{\beta }_{13}}\,\!}$ must be included in the model. These are the coefficients ${\displaystyle {{\beta }_{0}}\,\!}$, ${\displaystyle {{\beta }_{1}}\,\!}$, ${\displaystyle {{\beta }_{2}}\,\!}$, ${\displaystyle {{\beta }_{12}}\,\!}$ and ${\displaystyle {{\beta }_{3}}\,\!}$. Similarly the model before ${\displaystyle {{\beta }_{13}}\,\!}$ is added must contain all coefficients of the equation given above except ${\displaystyle {{\beta }_{13}}\,\!}$. This model can be obtained as follows:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+{{\beta }_{12}}{{x}_{1}}{{x}_{2}}+{{\beta }_{3}}{{x}_{3}}+\epsilon \,\!}$

The sequential sum of squares for ${\displaystyle {{\beta }_{13}}\,\!}$ can be calculated as follows:

{\displaystyle {\begin{aligned}S{{S}_{R}}({{\beta }_{13}}|{{\beta }_{0}},{{\beta }_{1}},{{\beta }_{2}},{{\beta }_{12}},{{\beta }_{3}})&=&S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}},{{\beta }_{2}},{{\beta }_{12}},{{\beta }_{3}},{{\beta }_{13}})-S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}},{{\beta }_{2}},{{\beta }_{12}},{{\beta }_{3}})\end{aligned}}\,\!}

For the present case, ${\displaystyle {{\theta }_{2}}=[{{\beta }_{13}}{]}'\,\!}$ and ${\displaystyle {{\theta }_{1}}=[{{\beta }_{0}},{{\beta }_{1}},{{\beta }_{2}},{{\beta }_{12}},{{\beta }_{3}}{]}'\,\!}$. It can be noted that for the sequential sum of squares ${\displaystyle {{\beta }_{1}}\,\!}$ contains all coefficients proceeding the coefficient being tested.

The sequential sum of squares for all terms will add up to the regression sum of squares for the full model, but the sequential sum of squares are order dependent.

##### Example

This example illustrates the partial ${\displaystyle F\,\!}$ test using the sequential sum of squares. The test is conducted for the coefficient ${\displaystyle {{\beta }_{1}}\,\!}$ corresponding to the predictor variable ${\displaystyle {{x}_{1}}\,\!}$ for the data. The regression model used for this data set in the example is:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{2}}{{x}_{2}}+\epsilon \,\!}$

The null hypothesis to test the significance of ${\displaystyle {{\beta }_{1}}\,\!}$ is:

${\displaystyle {{H}_{0}}:{{\beta }_{1}}=0\,\!}$

The statistic to test this hypothesis is:

${\displaystyle {{F}_{0}}={\frac {S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}})/r}{M{{S}_{E}}}}\,\!}$

where ${\displaystyle S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}})\,\!}$ represents the sequential sum of squares for ${\displaystyle {{\beta }_{1}}\,\!}$, ${\displaystyle r\,\!}$ represents the number of degrees of freedom for ${\displaystyle S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}})\,\!}$ (which is one because there is just one coefficient, ${\displaystyle {{\beta }_{1}}\,\!}$, being tested) and ${\displaystyle M{{S}_{E}}\,\!}$ is the error mean square and has been calculated in the second example as 30.24.

The sequential sum of squares for ${\displaystyle {{\beta }_{1}}\,\!}$ is the difference between the regression sum of squares for the model after adding ${\displaystyle {{\beta }_{1}}\,\!}$, ${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+\epsilon \,\!}$, and the regression sum of squares for the model before adding ${\displaystyle {{\beta }_{1}}\,\!}$, ${\displaystyle Y={{\beta }_{0}}+\epsilon \,\!}$. The regression sum of squares for the model ${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+\epsilon \,\!}$ is obtained as shown next. First the design matrix for this model, ${\displaystyle {{X}_{{{\beta }_{0}},{{\beta }_{1}}}}\,\!}$, is obtained by dropping the third column in the design matrix for the full model, ${\displaystyle X\,\!}$ (the full design matrix, ${\displaystyle X\,\!}$, was obtained in the example). The third column of ${\displaystyle X\,\!}$ corresponds to coefficient ${\displaystyle {{\beta }_{2}}\,\!}$ which is no longer used in the present model. Therefore, the design matrix for the model, ${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+\epsilon \,\!}$, is:

${\displaystyle {{X}_{{{\beta }_{0}},{{\beta }_{1}}}}=\left[{\begin{matrix}1&41.9\\1&43.4\\.&.\\.&.\\1&77.8\\\end{matrix}}\right]\,\!}$

The hat matrix corresponding to this design matrix is ${\displaystyle {{H}_{{{\beta }_{0}},{{\beta }_{1}}}}\,\!}$. It can be calculated using ${\displaystyle {{H}_{{{\beta }_{0}},{{\beta }_{1}}}}={{X}_{{{\beta }_{0}},{{\beta }_{1}}}}{{(X_{{{\beta }_{0}},{{\beta }_{1}}}^{\prime }{{X}_{{{\beta }_{0}},{{\beta }_{1}}}})}^{-1}}X_{{{\beta }_{0}},{{\beta }_{1}}}^{\prime }\,\!}$. Once ${\displaystyle {{H}_{{{\beta }_{0}},{{\beta }_{1}}}}\,\!}$ is known, the regression sum of squares for the model ${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+\epsilon \,\!}$ can be calculated as:

{\displaystyle {\begin{aligned}S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}})&=&{{y}^{\prime }}\left[{{H}_{{{\beta }_{0}},{{\beta }_{1}}}}-({\frac {1}{n}})J\right]y\\&=&12530.85\end{aligned}}\,\!}

The regression sum of squares for the model ${\displaystyle Y={{\beta }_{0}}+\epsilon \,\!}$ is equal to zero since this model does not contain any variables. Therefore:

${\displaystyle S{{S}_{R}}({{\beta }_{0}})=0\,\!}$

The sequential sum of squares for ${\displaystyle {{\beta }_{1}}\,\!}$ is:

{\displaystyle {\begin{aligned}S{{S}_{R}}({{\beta }_{1}}|{{\beta }_{0}})&=&S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}})-S{{S}_{R}}({{\beta }_{0}})\\&=&12530.85-0\\&=&12530.85\end{aligned}}\,\!}

Knowing the sequential sum of squares, the statistic to test the significance of ${\displaystyle {{\beta }_{1}}\,\!}$ is:

{\displaystyle {\begin{aligned}{{f}_{0}}&=&{\frac {S{{S}_{R}}({{\beta }_{0}},{{\beta }_{1}})/r}{M{{S}_{E}}}}\\&=&{\frac {12530.85/1}{30.24}}\\&=&414.366\end{aligned}}\,\!}

The ${\displaystyle p\,\!}$ value corresponding to this statistic based on the ${\displaystyle F\,\!}$ distribution with 1 degree of freedom in the numerator and 14 degrees of freedom in the denominator is:

{\displaystyle {\begin{aligned}p{\text{ }}value&=&1-P(F\leq {{f}_{0}})\\&=&1-0.999999\\&=&8.46\times {{10}^{-12}}\end{aligned}}\,\!}

Assuming that the desired significance is 0.1, since ${\displaystyle p\,\!}$ value < 0.1, ${\displaystyle {{H}_{0}}:{{\beta }_{1}}=0\,\!}$ is rejected and it can be concluded that ${\displaystyle {{\beta }_{1}}\,\!}$ is significant. The test for ${\displaystyle {{\beta }_{2}}\,\!}$ can be carried out in a similar manner. This result is shown in the following figure.

## Confidence Intervals in Multiple Linear Regression

Calculation of confidence intervals for multiple linear regression models are similar to those for simple linear regression models explained in Simple Linear Regression Analysis.

### Confidence Interval on Regression Coefficients

A 100 (${\displaystyle 1-\alpha \,\!}$) percent confidence interval on the regression coefficient, ${\displaystyle {{\beta }_{j}}\,\!}$, is obtained as follows:

${\displaystyle {{\hat {\beta }}_{j}}\pm {{t}_{\alpha /2,n-(k+1)}}{\sqrt {{C}_{jj}}}\,\!}$

The confidence interval on the regression coefficients are displayed in the Regression Information table under the Low Confidence and High Confidence columns as shown in the following figure.

Confidence Interval on Fitted Values, ${\displaystyle {{\hat {y}}_{i}}\,\!}$ A 100 (${\displaystyle 1-\alpha \,\!}$) percent confidence interval on any fitted value, ${\displaystyle {{\hat {y}}_{i}}\,\!}$, is given by:

${\displaystyle {{\hat {y}}_{i}}\pm {{t}_{\alpha /2,n-(k+1)}}{\sqrt {{{\hat {\sigma }}^{2}}x_{i}^{\prime }{{({{X}^{\prime }}X)}^{-1}}{{x}_{i}}}}\,\!}$

where:

${\displaystyle {{x}_{i}}=\left[{\begin{matrix}1\\{{x}_{i1}}\\.\\.\\.\\{{x}_{ik}}\\\end{matrix}}\right]\,\!}$

In the above example, the fitted value corresponding to the fifth observation was calculated as ${\displaystyle {{\hat {y}}_{5}}=266.3\,\!}$. The 90% confidence interval on this value can be obtained as shown in the figure below. The values of 47.3 and 29.9 used in the figure are the values of the predictor variables corresponding to the fifth observation the table.

### Confidence Interval on New Observations

As explained in Simple Linear Regression Analysis, the confidence interval on a new observation is also referred to as the prediction interval. The prediction interval takes into account both the error from the fitted model and the error associated with future observations. A 100 (${\displaystyle 1-\alpha \,\!}$) percent confidence interval on a new observation, ${\displaystyle {{\hat {y}}_{p}}\,\!}$, is obtained as follows:

${\displaystyle {{\hat {y}}_{p}}\pm {{t}_{\alpha /2,n-(k+1)}}{\sqrt {{{\hat {\sigma }}^{2}}(1+x_{p}^{\prime }{{({{X}^{\prime }}X)}^{-1}}{{x}_{p}})}}\,\!}$

where:

${\displaystyle {{x}_{p}}=\left[{\begin{matrix}1\\{{x}_{p1}}\\.\\.\\.\\{{x}_{pk}}\\\end{matrix}}\right]\,\!}$

${\displaystyle {{x}_{p1}}\,\!}$,..., ${\displaystyle {{x}_{pk}}\,\!}$ are the levels of the predictor variables at which the new observation, ${\displaystyle {{\hat {y}}_{p}}\,\!}$, needs to be obtained.

In multiple linear regression, prediction intervals should only be obtained at the levels of the predictor variables where the regression model applies. In the case of multiple linear regression it is easy to miss this. Having values lying within the range of the predictor variables does not necessarily mean that the new observation lies in the region to which the model is applicable. For example, consider the next figure where the shaded area shows the region to which a two variable regression model is applicable. The point corresponding to ${\displaystyle p\,\!}$ th level of first predictor variable, ${\displaystyle {{x}_{1}}\,\!}$, and ${\displaystyle p\,\!}$ th level of the second predictor variable, ${\displaystyle {{x}_{2}}\,\!}$, does not lie in the shaded area, although both of these levels are within the range of the first and second predictor variables respectively. In this case, the regression model is not applicable at this point.

As in the case of simple linear regression, analysis of a fitted multiple linear regression model is important before inferences based on the model are undertaken. This section presents some techniques that can be used to check the appropriateness of the multiple linear regression model.

### Coefficient of Multiple Determination, R2

The coefficient of multiple determination is similar to the coefficient of determination used in the case of simple linear regression. It is defined as:

{\displaystyle {\begin{aligned}{{R}^{2}}&=&{\frac {S{{S}_{R}}}{S{{S}_{T}}}}\\&=&1-{\frac {S{{S}_{E}}}{S{{S}_{T}}}}\end{aligned}}\,\!}

${\displaystyle {{R}^{2}}\,\!}$ indicates the amount of total variability explained by the regression model. The positive square root of ${\displaystyle {{R}^{2}}\,\!}$ is called the multiple correlation coefficient and measures the linear association between ${\displaystyle Y\,\!}$ and the predictor variables, ${\displaystyle {{x}_{1}}\,\!}$, ${\displaystyle {{x}_{2}}\,\!}$... ${\displaystyle {{x}_{k}}\,\!}$.

The value of ${\displaystyle {{R}^{2}}\,\!}$ increases as more terms are added to the model, even if the new term does not contribute significantly to the model. An increase in the value of ${\displaystyle {{R}^{2}}\,\!}$ cannot be taken as a sign to conclude that the new model is superior to the older model. A better statistic to use is the adjusted ${\displaystyle {{R}^{2}}\,\!}$ statistic defined as follows:

{\displaystyle {\begin{aligned}R_{adj}^{2}&=&1-{\frac {M{{S}_{E}}}{M{{S}_{T}}}}\\&=&1-{\frac {S{{S}_{E}}/(n-(k+1))}{S{{S}_{T}}/(n-1)}}\\&=&1-({\frac {n-1}{n-(k+1)}})(1-{{R}^{2}})\end{aligned}}\,\!}

The adjusted ${\displaystyle {{R}^{2}}\,\!}$ only increases when significant terms are added to the model. Addition of unimportant terms may lead to a decrease in the value of ${\displaystyle R_{adj}^{2}\,\!}$.

In a DOE folio, ${\displaystyle {{R}^{2}}\,\!}$ and ${\displaystyle R_{adj}^{2}\,\!}$ values are displayed as R-sq and R-sq(adj), respectively. Other values displayed along with these values are S, PRESS and R-sq(pred). As explained in Simple Linear Regression Analysis, the value of S is the square root of the error mean square, ${\displaystyle M{{S}_{E}}\,\!}$, and represents the "standard error of the model."

PRESS is an abbreviation for prediction error sum of squares. It is the error sum of squares calculated using the PRESS residuals in place of the residuals, ${\displaystyle {{e}_{i}}\,\!}$, in the equation for the error sum of squares. The PRESS residual, ${\displaystyle {{e}_{(i)}}\,\!}$, for a particular observation, ${\displaystyle {{y}_{i}}\,\!}$, is obtained by fitting the regression model to the remaining observations. Then the value for a new observation, ${\displaystyle {{\hat {y}}_{p}}\,\!}$, corresponding to the observation in question, ${\displaystyle {{y}_{i}}\,\!}$, is obtained based on the new regression model. The difference between ${\displaystyle {{y}_{i}}\,\!}$ and ${\displaystyle {{\hat {y}}_{p}}\,\!}$ gives ${\displaystyle {{e}_{(i)}}\,\!}$. The PRESS residual, ${\displaystyle {{e}_{(i)}}\,\!}$, can also be obtained using ${\displaystyle {{h}_{ii}}\,\!}$, the diagonal element of the hat matrix, ${\displaystyle H\,\!}$, as follows:

${\displaystyle {{e}_{(i)}}={\frac {{e}_{i}}{1-{{h}_{ii}}}}\,\!}$

R-sq(pred), also referred to as prediction ${\displaystyle {{R}^{2}}\,\!}$, is obtained using PRESS as shown next:

${\displaystyle R_{pred}^{2}=1-{\frac {PRESS}{S{{S}_{T}}}}\,\!}$

The values of R-sq, R-sq(adj) and S are indicators of how well the regression model fits the observed data. The values of PRESS and R-sq(pred) are indicators of how well the regression model predicts new observations. For example, higher values of PRESS or lower values of R-sq(pred) indicate a model that predicts poorly. The figure below shows these values for the data. The values indicate that the regression model fits the data well and also predicts well.

### Residual Analysis

Plots of residuals, ${\displaystyle {{e}_{i}}\,\!}$, similar to the ones discussed in Simple Linear Regression Analysis for simple linear regression, are used to check the adequacy of a fitted multiple linear regression model. The residuals are expected to be normally distributed with a mean of zero and a constant variance of ${\displaystyle {{\sigma }^{2}}\,\!}$. In addition, they should not show any patterns or trends when plotted against any variable or in a time or run-order sequence. Residual plots may also be obtained using standardized and studentized residuals. Standardized residuals, ${\displaystyle {{d}_{i}}\,\!}$, are obtained using the following equation:

{\displaystyle {\begin{aligned}{{d}_{i}}&=&{\frac {{e}_{i}}{\sqrt {{\hat {\sigma }}^{2}}}}\\&=&{\frac {{e}_{i}}{\sqrt {M{{S}_{E}}}}}\end{aligned}}\,\!}

Standardized residuals are scaled so that the standard deviation of the residuals is approximately equal to one. This helps to identify possible outliers or unusual observations. However, standardized residuals may understate the true residual magnitude, hence studentized residuals, ${\displaystyle {{r}_{i}}\,\!}$, are used in their place. Studentized residuals are calculated as follows:

{\displaystyle {\begin{aligned}{{r}_{i}}&=&{\frac {{e}_{i}}{\sqrt {{{\hat {\sigma }}^{2}}(1-{{h}_{ii}})}}}\\&=&{\frac {{e}_{i}}{\sqrt {M{{S}_{E}}(1-{{h}_{ii}})}}}\end{aligned}}\,\!}

where ${\displaystyle {{h}_{ii}}\,\!}$ is the ${\displaystyle i\,\!}$ th diagonal element of the hat matrix, ${\displaystyle H\,\!}$. External studentized (or the studentized deleted) residuals may also be used. These residuals are based on the PRESS residuals mentioned in Coefficient of Multiple Determination, R2. The reason for using the external studentized residuals is that if the ${\displaystyle i\,\!}$ th observation is an outlier, it may influence the fitted model. In this case, the residual ${\displaystyle {{e}_{i}}\,\!}$ will be small and may not disclose that ${\displaystyle i\,\!}$ th observation is an outlier. The external studentized residual for the ${\displaystyle i\,\!}$ th observation, ${\displaystyle {{t}_{i}}\,\!}$, is obtained as follows:

${\displaystyle {{t}_{i}}={{e}_{i}}{{\left[{\frac {n-k}{S{{S}_{E}}(1-{{h}_{ii}})-e_{i}^{2}}}\right]}^{0.5}}\,\!}$

Residual values for the data are shown in the figure below. Standardized residual plots for the data are shown in next two figures. The Weibull++ DOE folio compares the residual values to the critical values on the ${\displaystyle t\,\!}$ distribution for studentized and external studentized residuals.

For other residuals the normal distribution is used. For example, for the data, the critical values on the ${\displaystyle t\,\!}$ distribution at a significance of 0.1 are ${\displaystyle {{t}_{0.05,14}}=1.761\,\!}$ and ${\displaystyle -{{t}_{0.05,14}}=-1.761\,\!}$ (as calculated in the example, Test on Individual Regression Coefficients (t Test)). The studentized residual values corresponding to the 3rd and 17th observations lie outside the critical values. Therefore, the 3rd and 17th observations are outliers. This can also be seen on the residual plots in the next two figures.

### Outlying x Observations

Residuals help to identify outlying ${\displaystyle y\,\!}$ observations. Outlying ${\displaystyle x\,\!}$ observations can be detected using leverage. Leverage values are the diagonal elements of the hat matrix, ${\displaystyle {{h}_{ii}}\,\!}$. The ${\displaystyle {{h}_{ii}}\,\!}$ values always lie between 0 and 1. Values of ${\displaystyle {{h}_{ii}}\,\!}$ greater than ${\displaystyle 2(k+1)/n\,\!}$ are considered to be indicators of outlying ${\displaystyle x\,\!}$ observations.

### Influential Observations Detection

Once an outlier is identified, it is important to determine if the outlier has a significant effect on the regression model. One measure to detect influential observations is Cook's distance measure which is computed as follows:

${\displaystyle {{D}_{i}}={\frac {r_{i}^{2}}{(k+1)}}\left[{\frac {{h}_{ii}}{(1-{{h}_{ii}})}}\right]\,\!}$

To use Cook's distance measure, the ${\displaystyle {{D}_{i}}\,\!}$ values are compared to percentile values on the ${\displaystyle F\,\!}$ distribution with ${\displaystyle (k+1,n-(k+1))\,\!}$ degrees of freedom. If the percentile value is less than 10 or 20 percent, then the ${\displaystyle i\,\!}$ th case has little influence on the fitted values. However, if the percentile value is close to 50 percent or greater, the ${\displaystyle i\,\!}$ th case is influential, and fitted values with and without the ${\displaystyle i\,\!}$ th case will differ substantially.

#### Example

Cook's distance measure can be calculated as shown next. The distance measure is calculated for the first observation of the data. The remaining values along with the leverage values are shown in the figure below (displaying Leverage and Cook's distance measure for the data).

The standardized residual corresponding to the first observation is:

{\displaystyle {\begin{aligned}{{r}_{1}}&=&{\frac {{e}_{1}}{\sqrt {M{{S}_{E}}(1-{{h}_{11}})}}}\\&=&{\frac {1.3127}{\sqrt {30.3(1-0.2755)}}}\\&=&0.2804\end{aligned}}\,\!}

Cook's distance measure for the first observation can now be calculated as:

{\displaystyle {\begin{aligned}{{D}_{1}}&=&{\frac {r_{1}^{2}}{(k+1)}}\left[{\frac {{h}_{11}}{(1-{{h}_{11}})}}\right]\\&=&{\frac {{0.2804}^{2}}{(2+1)}}\left[{\frac {0.2755}{(1-0.2755)}}\right]\\&=&0.01\end{aligned}}\,\!}

The 50th percentile value for ${\displaystyle {{F}_{3,14}}\,\!}$ is 0.83. Since all ${\displaystyle {{D}_{i}}\,\!}$ values are less than this value there are no influential observations.

### Lack-of-Fit Test

The lack-of-fit test for simple linear regression discussed in Simple Linear Regression Analysis may also be applied to multiple linear regression to check the appropriateness of the fitted response surface and see if a higher order model is required. Data for ${\displaystyle m\,\!}$ replicates may be collected as follows for all ${\displaystyle n\,\!}$ levels of the predictor variables:

{\displaystyle {\begin{aligned}&&{{y}_{11}},{{y}_{12}},....,{{y}_{1m}}{\text{ }}m{\text{ repeated observations at the first level }}\\&&{{y}_{21}},{{y}_{22}},....,{{y}_{2m}}{\text{ }}m{\text{ repeated observations at the second level}}\\&&...\\&&{{y}_{i1}},{{y}_{i2}},....,{{y}_{im}}{\text{ }}m{\text{ repeated observations at the }}i{\text{th level}}\\&&...\\&&{{y}_{n1}},{{y}_{n2}},....,{{y}_{nm}}{\text{ }}m{\text{ repeated observations at the }}n{\text{th level }}\end{aligned}}\,\!}

The sum of squares due to pure error, ${\displaystyle S{{S}_{PE}}\,\!}$, can be obtained as discussed in the Simple Linear Regression Analysis as:

${\displaystyle S{{S}_{PE}}={\underset {i=1}{\overset {n}{\mathop {\sum } }}}\,{\underset {j=1}{\overset {m}{\mathop {\sum } }}}\,{{({{y}_{ij}}-{{\bar {y}}_{i}})}^{2}}\,\!}$

The number of degrees of freedom associated with ${\displaystyle S{{S}_{PE}}\,\!}$ are:

${\displaystyle dof(S{S}_{PE})=nm-n\,\!}$

Knowing ${\displaystyle S{{S}_{PE}}\,\!}$, sum of squares due to lack-of-fit, ${\displaystyle S{{S}_{LOF}}\,\!}$, can be obtained as:

${\displaystyle S{{S}_{LOF}}=S{{S}_{E}}-S{{S}_{PE}}\,\!}$

The number of degrees of freedom associated with ${\displaystyle S{{S}_{LOF}}\,\!}$ are:

{\displaystyle {\begin{aligned}dof(S{{S}_{LOF}})&=&dof(S{{S}_{E}})-dof(S{{S}_{PE}})\\&=&n-(k+1)-(nm-n)\end{aligned}}\,\!}

The test statistic for the lack-of-fit test is:

{\displaystyle {\begin{aligned}{{F}_{0}}&=&{\frac {S{{S}_{LOF}}/dof(S{{S}_{LOF}})}{S{{S}_{PE}}/dof(S{{S}_{PE}})}}\\&=&{\frac {M{{S}_{LOF}}}{M{{S}_{PE}}}}\end{aligned}}\,\!}

## Other Topics in Multiple Linear Regression

### Polynomial Regression Models

Polynomial regression models are used when the response is curvilinear. The equation shown next presents a second order polynomial regression model with one predictor variable:

${\displaystyle Y={{\beta }_{0}}+{{\beta }_{1}}{{x}_{1}}+{{\beta }_{11}}x_{1}^{2}+\epsilon \,\!}$

Usually, coded values are used in these models. Values of the variables are coded by centering or expressing the levels of the variable as deviations from the mean value of the variable and then scaling or dividing the deviations obtained by half of the range of the variable.

${\displaystyle coded{\text{ }}value={\frac {actual{\text{ }}value-mean}{half{\text{ }}of{\text{ }}range}}\,\!}$

The reason for using coded predictor variables is that many times ${\displaystyle x\,\!}$ and ${\displaystyle {{x}^{2}}\,\!}$ are highly correlated and, if uncoded values are used, there may be computational difficulties while calculating the ${\displaystyle {{({{X}^{\prime }}X)}^{-1}}\,\!}$ matrix to obtain the estimates, ${\displaystyle {\hat {\beta }}\,\!}$, of the regression coefficients using the equation for the ${\displaystyle F\,\!}$ distribution given in Statistics Background on DOE.

### Qualitative Factors

The multiple linear regression model also supports the use of qualitative factors. For example, gender may need to be included as a factor in a regression model. One of the ways to include qualitative factors in a regression model is to employ indicator variables. Indicator variables take on values of 0 or 1. For example, an indicator variable may be used with a value of 1 to indicate female and a value of 0 to indicate male.

${\displaystyle {{x}_{1}}=\{{\begin{array}{*{35}{l}}1{\text{ Female}}\\0{\text{ Male}}\\\end{array}}\,\!}$

In general ( ${\displaystyle n-1\,\!}$ ) indicator variables are required to represent a qualitative factor with ${\displaystyle n\,\!}$ levels. As an example, a qualitative factor representing three types of machines may be represented as follows using two indicator variables:

{\displaystyle {\begin{aligned}{{x}_{1}}&=&1,{\text{ }}{{x}_{2}}&=&0{\text{ Machine Type I}}\\{{x}_{1}}&=&0,{\text{ }}{{x}_{2}}&=&1{\text{ Machine Type II}}\\{{x}_{1}}&=&0,{\text{ }}{{x}_{2}}&=&0{\text{ Machine Type III}}\end{aligned}}\,\!}

An alternative coding scheme fo