Difference between revisions of "Design and analysis of experiments (2013)"
Jump to navigation
Jump to search
Kevin Dunn (talk | contribs) |
Kevin Dunn (talk | contribs) |
||
Line 50: | Line 50: | ||
* 12 Mar 2013 (Class 09A): [http://learnche.mcmaster.ca/media/4C3-2013-Class-09A.mp3 Audio] and [http://learnche.mcmaster.ca/media/4C3-2013-Class-09A.mp4 video] | * 12 Mar 2013 (Class 09A): [http://learnche.mcmaster.ca/media/4C3-2013-Class-09A.mp3 Audio] and [http://learnche.mcmaster.ca/media/4C3-2013-Class-09A.mp4 video] | ||
* 13 Mar 2013 (Class 09B): [http://learnche.mcmaster.ca/media/4C3-2013-Class-09B.mp3 Audio] and [http://learnche.mcmaster.ca/media/4C3-2013-Class-09B.mp4 video] | * 13 Mar 2013 (Class 09B): [http://learnche.mcmaster.ca/media/4C3-2013-Class-09B.mp3 Audio] and [http://learnche.mcmaster.ca/media/4C3-2013-Class-09B.mp4 video] | ||
== Software source code == | |||
Use R to estimate the DOE model | |||
<syntaxhighlight lang="sas"> | |||
T <- c(-1, +1, -1, +1) # centered and scaled temperature | |||
S <- c(-1, -1, +1, +1) # centered and scaled substrate concentration | |||
y <- c(69, 60, 64, 53) # conversion is the response, y | |||
mod <- lm(y ~ T + S + T*S) | |||
summary(mod) | |||
Call: | |||
lm(formula = y ~ T + S + T * S) | |||
Residuals: | |||
ALL 4 residuals are 0: no residual degrees of freedom! | |||
Coefficients: | |||
Estimate Std. Error t value Pr(>|t|) | |||
(Intercept) 61.5 NA NA NA | |||
T -5.0 NA NA NA | |||
S -3.0 NA NA NA | |||
T:S -0.5 NA NA NA | |||
Residual standard error: NaN on 0 degrees of freedom | |||
Multiple R-squared: 1, Adjusted R-squared: NaN | |||
F-statistic: NaN on 3 and 0 DF, p-value: NA | |||
</syntaxhighlight> | |||
You could also use MATLAB if you prefer: | |||
<syntaxhighlight lang="matlab"> | |||
% Set up the X matrix: | |||
n = 4; | |||
temperature = [-1, +1, -1, +1]; | |||
substrate = [-1, -1, +1, +1]; | |||
X = [ ones(n, 1), temperature', substrate', (temperature .* substrate)']; | |||
% or you can type it in directly (but this is error prone) | |||
X = [+1 -1 -1 +1; ... | |||
+1 +1 -1 -1; ... | |||
+1 -1 +1 -1; ... | |||
+1 +1 +1 +1]; | |||
% Conversion is your y-variable | |||
y = [69, 60, 64, 53]'; | |||
% Regression coefficients = b = [Intercept, b_T, b_S, b_{TS}] | |||
b = inv(X'*X)*X'*y | |||
</syntaxhighlight> |
Revision as of 03:24, 15 March 2013
Class date(s): | 08 March 2013 to 03 April 2013 | ||||
(PDF) | Course slides | ||||
| |||||
| |||||
| |||||
Course notes and slides
- Course textbook (print chapter 5)
- Slides for class
Class materials
- 08 Mar 2013 (Class 08C): Audio and video and guest speaker's slides (Emily Nichols)
- 12 Mar 2013 (Class 09A): Audio and video
- 13 Mar 2013 (Class 09B): Audio and video
Software source code
Use R to estimate the DOE model
T <- c(-1, +1, -1, +1) # centered and scaled temperature
S <- c(-1, -1, +1, +1) # centered and scaled substrate concentration
y <- c(69, 60, 64, 53) # conversion is the response, y
mod <- lm(y ~ T + S + T*S)
summary(mod)
Call:
lm(formula = y ~ T + S + T * S)
Residuals:
ALL 4 residuals are 0: no residual degrees of freedom!
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 61.5 NA NA NA
T -5.0 NA NA NA
S -3.0 NA NA NA
T:S -0.5 NA NA NA
Residual standard error: NaN on 0 degrees of freedom
Multiple R-squared: 1, Adjusted R-squared: NaN
F-statistic: NaN on 3 and 0 DF, p-value: NA
You could also use MATLAB if you prefer:
% Set up the X matrix:
n = 4;
temperature = [-1, +1, -1, +1];
substrate = [-1, -1, +1, +1];
X = [ ones(n, 1), temperature', substrate', (temperature .* substrate)'];
% or you can type it in directly (but this is error prone)
X = [+1 -1 -1 +1; ...
+1 +1 -1 -1; ...
+1 -1 +1 -1; ...
+1 +1 +1 +1];
% Conversion is your y-variable
y = [69, 60, 64, 53]';
% Regression coefficients = b = [Intercept, b_T, b_S, b_{TS}]
b = inv(X'*X)*X'*y