MTB > name c1 as 'ethno'
MTB > name c2 as 'schtype'
MTB > name c3 as 'race'
MTB > read data from 'integ.dat' into c1 c2 c3
    200 ROWS READ
 ROW  ethno  schtype   race

   1     15        1      1
   2     12        1      1
   3     14        1      1
   4     15        1      1
  .  .  .
MTB > table c2 c3;
SUBC>   mean 'ethno'.
 
 ROWS: schtype     COLUMNS: race
 
           1        2      ALL
  
  1   17.080   12.940   15.010
  2   14.540   15.020   14.780
 ALL  15.810   13.980   14.895
 
  CELL CONTENTS --
            ethno:MEAN

MTB > twoway 'ethno' 'schtype' 'race'

ANALYSIS OF VARIANCE  ethno   

SOURCE        DF        SS        MS
schtype        1       2.6       2.6
race           1     167.4     167.4
INTERACTION    1     266.8     266.8
ERROR        196    3689.9      18.8
TOTAL        199    4126.8

MTB > stop
*** Minitab Release 5.1 *** Minitab, Inc. ***

--------------------------------------------------------------------------
END OF TWOWAY INTRO--REDO WITH ANOVA COMMAND
added to illustrate the anova command Minitab version 7
--------------------------------------------------------------
 MTB > read 'integ.dat' c1-c3
     200 ROWS READ
 
  ROW    C1   C2   C3
 
    1    15    1    1
    2    12    1    1
    3    14    1    1
    4    15    1    1
   .  .  .
-----------------------
Now that we have the data, let's look at the help
material on the anova command
------------------------
 
 MTB > help anova
 ANOVA  model
 
 Subcommands:  RANDOM    FITS    MEANS      RESTRICT
               EMS       TEST    RESIDUALS
 
 This command performs analysis of variance for multi-way
 balanced designs, i.e., each cell must have the same number of
 observations, and one-way analysis of variance for unbalanced
 designs.
 
 ANOVA calculates all exact F-tests, prints expected mean
 squares, and estimates variance components.  You may specify
 your own tests, store residuals and fitted values, and print
 cell and marginal means.  You can list several response
 variables on one command.
 
 How to Specify the Model in ANOVA
 
 ANOVA uses a simplified version of a model as it appears in many
 textbooks.  Here are some examples:
 
    Three factors crossed:      ANOVA Y=A B C A*B A*C B*C A*B*C
    Three factors nested:       ANOVA Y=A B(A) C(A B)
    Crossed and nested design:  ANOVA Y=A B(A) C A*C B*C(A)
 
 List the terms you want in your model after the equal sign.
 Interactions are indicated with asterisks.  For example, A*B is
 the interaction between factors A and B.  Nested factors are
 indicated with parentheses.  For example, B(A) is B nested
 within A and C(A B) is C nested within A and B.
 
 Several rules apply only to ANOVA (and ANCOVA).  You may omit
 the quotes around variable names.  Because of this, variable
 names used in ANOVA must start with a letter and contain only
 letters and numbers.  Alternatively, you can use C1, C2, etc. to
 denote data columns.  You can use special symbols in a variable
 name, but then you must enclose the name in single quotes, as on
 other Minitab commands.  You may not put any extra text on the
 ANOVA line, except after the symbol #.
 
 Two symbols allow you to abbreviate a model.  A vertical bar (or
 exclamation point) indicates crossed factors, and a minus sign
 removes terms.  For example:
 
    ANOVA Y=A B|C E                   is equivalent to
    ANOVA Y=A B C B*C E
 
    ANOVA Y=A|B|C - A*B               is equivalent to
    ANOVA Y=A B C A*C B*C A*B*C
 
    ANCOVA Y=A|B(A)|C                 is equivalent to
    ANCOVA Y=A B(A) C A*C B*C(A)
 
 In general, all crossings are done for factors separated by
 bars, unless the cross results in an illegal term.  For example,
 in the third example, the potential term A*B(A) is illegal and
 Minitab automatically omits it.  Note, if a factor is nested
 then you must indicate this when using the bar, as in the fourth
 example with the term B(A).
 

 You can fit reduced models, for example:  Y = A B C A*B is a
 three-factor model with just one two-way interaction.  Models,
 however, must be hierarchical.  For example, if the term A*B*C
 is in the model, then the terms A B C A*B A*C B*C must also be
 in the model.  And if B(A) is in the model, then A must be also.
 
 Several response variables can be included with one model.  For
 example, ANOVA Y1 Y2 Y3 = A B will do three separate analyses,
 one for Y1, one for Y2 and one for Y3.
 
 Minitab checks to see if your model is valid and gives an error
 message if it is not.  Minitab also checks to see if your data
 set is balanced, i.e. has an equal number of observations per
 cell.  Note:  balanced data are not required for one factor
 models.
 
 Models with many terms can take a long time to compute.  One
 rule of thumb is that, in a completely crossed model with all
 interaction terms, each additional factor triples the
 computation time.
 

 A Simple Example:
 
 We fit a two-way crossed model using the potato rot data from
 the Minitab Handbook.  Potato rot was measured in potatoes
 stored at two different temperatures (factor 1) and at three
 levels of oxygen (factor 2).
 
    MTB > ANOVA ROT = TEMP|OXYGEN;
    SUBC>  MEANS TEMP|OXYGEN;
    SUBC>  FITS C5;
    SUBC>  RESIDUALS C6.
------------------------------------------------------------
NOW LET'S IMPLEMENT THE ANOVA COMMAND FOR INTEG.DAT
a two way crossed design
-----------------------------------------------------------


 MTB > anova c1 = c2|c3
 
 Factor     Type Levels Values
 C2        fixed      2     1     2
 C3        fixed      2     1     2
 
 Analysis of Variance for C1
 
 Source      DF         SS         MS       F      P
 C2           1       2.64       2.64    0.14  0.708
 C3           1     167.45     167.45    8.89  0.003
 C2*C3        1     266.80     266.80   14.17  0.000
 Error      196    3689.90      18.83
 Total      199    4126.79

----------------------------------------

