FoggyFinder,

I had some trouble understanding your example so I wrote up another that might help someone else looking at this post. This is a 2^3 full factorial experiment design (i.e. three variables with two levels each, -1 and 1) with one replicate, i.e. 8 observations.

THANK YOU for the Dim X As Double () () … code line! I have no idea what that does and would never have figured it out myself.

P.

```
Console.WriteLine("A 2^3 full factorial experiment analyzed by MR, main effects only.")
Dim X As Double()() = New Double(7)() {} '7+1 = 8 is the number of observations
X(0) = New Double() {-1, -1, -1} 'these are the predictor settings for the first observation, i.e. x1 = -1, x2 = -1, x3 = -1
X(1) = New Double() {-1, -1, 1}
X(2) = New Double() {-1, 1, -1}
X(3) = New Double() {-1, 1, 1}
X(4) = New Double() {1, -1, -1}
X(5) = New Double() {1, -1, 1}
X(6) = New Double() {1, 1, -1}
X(7) = New Double() {1, 1, 1} 'last, 8th observation
Dim Y() As Double = {10, 20, 110, 120, 20, 30, 140, 150} 'the 8 values of the response Y
Dim MR_Coeffs = MathNet.Numerics.LinearRegression.MultipleRegression.DirectMethod(X, Y, True)
Console.WriteLine("The MR coefficients are " & MR_Coeffs(0).ToString & ", " & MR_Coeffs(1).ToString & ", " & MR_Coeffs(2).ToString & ", " & MR_Coeffs(3).ToString)
```