MATLAB: What is the algorithm to estimate model coefficients in a Central Composite Rotatable Design

anovalinear regression

The coded variables for the four factors are as follows: X1 =[-1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 0 0 -2 2 0 0 0 0 0 0]'; X2 =[-1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 1 0 0 0 0 -2 2 0 0 0 0]'; X3 =[-1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 1 0 0 0 0 0 0 -2 2 0 0]'; X4 =[-1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 -2 2]'; D=[X1 X2 X3 X4];
Y = [247, 250, 248, 253, 243, 243, 245, 245, 249, 254, 249, 258, 243, 244, 245, 246, 246, 246, 246, 267, 244, 248, 248, 242, 245, 247]';
The matrix D consist of the initial 16 runs and 2k(8) runs and 2 replicates at the center.It is required to determine the coefficients for the Main effects, Interaction effects and quadratic terms. In addition, I would appreciate if you can include the algorithm for the ANOVA table.

Best Answer

You could use backlash if you first form an array A of the constant, linear, interaction, and squared terms. Then compute A\Y.
If you have the Statistics Toolbox, you could use regstats:
regstats(Y,D,'quadratic')
If you have a recent release of the Statistics Toolbox you could use a LinearModel. It has an anova method (function):
m = LinearModel.fit(D,Y,'quadratic')