
Regression and Correlation 335
[G]
−1
is the inverse of the coefficient matrix.
Example Problem 8.9
Statement: An experiment is conducted in which the values of three independent
variables, x, y, and z, are selected and then the resulting value of the dependent variable
R is measured. This procedure is repeated six times for different combinations of x, y,
and z values. The [x,y,z,R] data values are [1,3,1,17; 2,4,2,24; 3,5,1,25; 4,4,2,30; 5,3,1,24;
6,3,2,31]. Determine the regression coefficients for the multi-variable regression fit of
the data. Then, using the resulting best-fit expression, determine the calculated values
of R in comparison to their respective measured values.
Solution: The solution is obtained using MATLAB’s left-division method by typing
G\R, where [G] for this example is
1 1 3 1
1 2 4 2
1 3 5 1
1 4 4 2
1 5 3 1
1 6 3 2
and [R] is
17
24
25
30
24
31
.
The resulting regression coefficient matrix is
3.4865
2.0270
2.2162
4.3063
.
Thus, the best-fit expression is
3.4865 + 2.0270x + 2.2162y + 4.3063z = R. (8.83)
The calculated values of R are obtained by typing G*ans after the regression coefficient
solution is obtained. The values are 16.4685, 25.0180, 24.9550, 29.0721, 24.5766, and
30.9099. All calculated values agree with their respective values to within a difference
of less than 1.0.