Anovadoe: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Scott
(Created page with "===Purpose=== Function to perform ANOVA for 2^k factorial model X, Y data. ===Synopsis=== : out = anovadoe(x, y) : out = anovadoe(x, y, column_ID, options) : out = anovadoe(...")
 
imported>Scott
No edit summary
Line 19: Line 19:
* '''x''' = matrix describing the settings of each X variable (cols) for each sample (row). Typically this would be a 2^k DOE design matrix. The origin/identity of each column is described in the 'column_ID' var.
* '''x''' = matrix describing the settings of each X variable (cols) for each sample (row). Typically this would be a 2^k DOE design matrix. The origin/identity of each column is described in the 'column_ID' var.
* '''y''' = the experimental Y value determined for each experiment/row of X.
* '''y''' = the experimental Y value determined for each experiment/row of X.


====Optional Inputs====
====Optional Inputs====
Line 25: Line 24:




====Outputs====
* '''column_ID''' = a cell array of numerical values which describes the multiplicative origin of each column of X. If x is a DOE dataset object, this input can be omitted (the information will be included in the dataset object) If omitted, each column of X is assumed to be a unique (non-interation) factor.
* '''column_ID''' = a cell array of numerical values which describes the multiplicative origin of each column of X. If x is a DOE dataset object, this input can be omitted (the information will be included in the dataset object) If omitted, each column of X is assumed to be a unique (non-interation) factor.
:NOTE: The number of columns in x must = number of cells in column_ID.
:NOTE: The number of columns in x must = number of cells in column_ID.
:NOTE: If an intercept is to be explicitly included as a column of
:NOTE: If an intercept is to be explicitly included as a column of 'ones' in the x matrix (as in a regression), then that column must be represented as a '0' in column_ID.  A DOE design does not typically have an explicit intercept.
%          'ones' in the x matrix (as in a regression), then that column
:NOTE: Further, the numbers in column_ID must be in increasing order by single digits, 2 digits, 3 digits, etc.  (and obviously must match the x  matrix).
%          must be represented as a '0' in column_ID.  A DOE design does
:Examples:  
%          not typically have an explicit intercept.
:<pre> column_ID = {[1] [2] [1 2]};</pre>
%      *** Further, the numbers in column_ID must be in increasing order by
:Indicates how columns were derived. Multiple numbers indicate interaction and which original columns were used to calculate design vars.  Here, 1 and 2 are independent columns, but column 3 is a dependent column derived from the product of 1 and 2.  Column 3 will be used to calculate the interaction of factors 1 and 2. The term [1 2] must appear after the term [1].  Further, a term [1 2 3] must appear after a term [1 2], which must likewise appear after a term [1].
%          single digits, 2 digits, 3 digits, etc.  (and obviously must
:<pre>column_ID = {[1] [2] [1 2] [1 3] [2 3] [1 2 3]};</pre>
%          match the x  matrix).
%      Examples:  
%        column_ID = {[1] [2] [1 2]};
%      Indicates how columns were derived. Multiple numbers indicate
%      interaction and which original columns were used to calculate
%      design vars.  Here, 1 and 2 are independent columns, but column 3
%      is a dependent column derived from the product of 1 and 2.  Column
%      3 will be used to calculate the interaction of factors 1 and 2.
%      The term [1 2] must appear after the term [1].  Further, a term [1
%      2 3] must appear after a term [1 2], which must likewise appear
%      after a term [1].
%        column_ID = {[1] [2] [1 2] [1 3] [2 3] [1 2 3]};
%
%      If you include an interaction term e.g. [1 2 3] in a model, all
%      subterms encompassed by the highest order term must also be
%      included. So subterms [1] [2] [1 2] [1 3] [2 3] all be included.


:If you include an interaction term e.g. [1 2 3] in a model, all subterms encompassed by the highest order term must also be included. So subterms [1] [2] [1 2] [1 3] [2 3] all be included.
====Outputs===
:'''out''' = a structure containing the sum of squares, mean square values, F-test values, F-critical values, and p-values for each column/treatment, for the model as a whole, for overall residual error, and for lack-of-fit and pure error (if replication was present).


===Options===
===Options===
options =  a structure array with the following fields:
options =  a structure array with the following fields:
 
* '''plots''': [ {'none'} | 'final' ] governs plotting of results.
 
* '''plots''': [ {'none'} | 'final' ] governs plotting of results, and
* '''order''': positive integer for polynomial order {default = 1}.
 
 
===Example===
 
 
<pre>
>>This is an example
Error: does not exist
</pre>




===See Also===
===See Also===
 
[[ANOVA1W]], [[ANOVA2W]]
%
% OPTIONAL INPUTS:
%  column_ID = a cell array of numerical values which describes the
%              multiplicative origin of each column of X. If x is a
%              DOE dataset object, this input can be omitted (the
%              information will be included in the dataset object)
%              If omitted, each column of X is assumed to be a unique
%              (non-interation) factor.
%      *  The number of columns in x must = number of cells in column_ID.
%      **  If an intercept is to be explicitly included as a column of
%          'ones' in the x matrix (as in a regression), then that column
%          must be represented as a '0' in column_ID.  A DOE design does
%          not typically have an explicit intercept.
%      *** Further, the numbers in column_ID must be in increasing order by
%          single digits, 2 digits, 3 digits, etc.  (and obviously must
%          match the x  matrix).
%      Examples:
%        column_ID = {[1] [2] [1 2]}; 
%      Indicates how columns were derived. Multiple numbers indicate
%      interaction and which original columns were used to calculate
%      design vars.  Here, 1 and 2 are independent columns, but column 3
%      is a dependent column derived from the product of 1 and 2.  Column
%      3 will be used to calculate the interaction of factors 1 and 2.
%      The term [1 2] must appear after the term [1].  Further, a term [1
%      2 3] must appear after a term [1 2], which must likewise appear
%      after a term [1].
%        column_ID = {[1] [2] [1 2] [1 3] [2 3] [1 2 3]};
%
%      If you include an interaction term e.g. [1 2 3] in a model, all
%      subterms encompassed by the highest order term must also be
%      included. So subterms [1] [2] [1 2] [1 3] [2 3] all be included.
%
%  options  = Options structure with one or more of the following fields.
%              Options can be passed in place of column_ID.
%
%          display : [{'off'}| 'on' ] governs output to the command window.
%
% OUTPUTS:
%  out = a structure containing the sum of squares, mean square values,
%        F-test values, F-critical values, and p-values for each
%        column/treatment, for the model as a whole, for overall residual
%        error, and for lack-of-fit and pure error (if replication was
%        present).
%
%I/O: out = anovadoe(x, y);
%I/O: out = anovadoe(x, y, column_ID, options);
%I/O: out = anovadoe(x, y, options);

Revision as of 10:16, 12 September 2011

Purpose

Function to perform ANOVA for 2^k factorial model X, Y data.


Synopsis

out = anovadoe(x, y)
out = anovadoe(x, y, column_ID, options)
out = anovadoe(x, y, options)

Description

Performs ANOVA for the model described by the submitted X data relative to the Y data. Each column of X is design in a specific way to allow the calculation of an effect due to the specific main effect or interaction used to design each specific column. The main output is a statistical test of the significance of each term (eg., column) of the X matrix, a test of the overall model, and a test for lack-of-fit. There are additional statistical values supplied that support the above test metrics that might be used to construct a typical ANOVA table if desired.

Inputs

  • x = matrix describing the settings of each X variable (cols) for each sample (row). Typically this would be a 2^k DOE design matrix. The origin/identity of each column is described in the 'column_ID' var.
  • y = the experimental Y value determined for each experiment/row of X.

Optional Inputs

  • second = optional second input is this.


  • column_ID = a cell array of numerical values which describes the multiplicative origin of each column of X. If x is a DOE dataset object, this input can be omitted (the information will be included in the dataset object) If omitted, each column of X is assumed to be a unique (non-interation) factor.
NOTE: The number of columns in x must = number of cells in column_ID.
NOTE: If an intercept is to be explicitly included as a column of 'ones' in the x matrix (as in a regression), then that column must be represented as a '0' in column_ID. A DOE design does not typically have an explicit intercept.
NOTE: Further, the numbers in column_ID must be in increasing order by single digits, 2 digits, 3 digits, etc. (and obviously must match the x matrix).
Examples:
 column_ID = {[1] [2] [1 2]};
Indicates how columns were derived. Multiple numbers indicate interaction and which original columns were used to calculate design vars. Here, 1 and 2 are independent columns, but column 3 is a dependent column derived from the product of 1 and 2. Column 3 will be used to calculate the interaction of factors 1 and 2. The term [1 2] must appear after the term [1]. Further, a term [1 2 3] must appear after a term [1 2], which must likewise appear after a term [1].
column_ID = {[1] [2] [1 2] [1 3] [2 3] [1 2 3]};
If you include an interaction term e.g. [1 2 3] in a model, all subterms encompassed by the highest order term must also be included. So subterms [1] [2] [1 2] [1 3] [2 3] all be included.

=Outputs

out = a structure containing the sum of squares, mean square values, F-test values, F-critical values, and p-values for each column/treatment, for the model as a whole, for overall residual error, and for lack-of-fit and pure error (if replication was present).

Options

options = a structure array with the following fields:

  • plots: [ {'none'} | 'final' ] governs plotting of results.


See Also

ANOVA1W, ANOVA2W