 MTB > read 'twins' c100 c1-c8
      27 ROWS READ
 
 MTB > name c100 'pair_no'
 MTB > name c1 'fos-IQ' c2 'nat-IQ' c3 'hi-SES' c4 'med-SES' c5 'low-SES'
 MTB > #
 MTB > # This data was originally used by Cyril Burt (1966) to explore
 MTB > # the 'nature vs. nurture' question for intelligence.  n=27 twins
 MTB > # were found in which one member of the pair was raised in a foster
 MTB > # home and one member was raised by the twins' natural parents.
 MTB > #
 MTB > # The goal is to use linear regression to explore the relationships
 MTB > # between nature (IQ separate from environmental influences such as
 MTB > # parental guidance) and nurture (IQ as influenced by parental
 MTB > # guidance, by SES, etc.  The main data is as follows:
 MTB > #
 MTB > # fos-IQ and nat-IQ are the respective IQ's of each pair member.
 MTB > # The SES variables are 0/1 indicator variables (also called
 MTB > # dummy or categorical variables) that code the SES.  For example,
 MTB > # "low-SES" is 1 for twins whose natural parents are from a low
 MTB > # social class, and 0 for the other twins.  Similarly for the other
 MTB > # SES variables. 
 MTB >  
 MTB > # Before we charge ahead, let's look at the data.  We want to
 MTB > # plot all the data, but label the data pairs from different SES's
 MTB > # differently...
 MTB > name c10 'labels'
 MTB > let 'labels' = 1*'low-SES' + 2*'med-SES' + 3*'hi-SES'
 MTB > lplot 'fos-IQ' against 'nat-IQ' using 'labels'
 
          -
          -                                                        C
       125+
          -
  fos-IQ  -                            A              C           C
          -                            A       B      C
          -                                 A A
       100+                                        A
          -               B    2    AA B
          -                       C      B
          -               A  A      A
          -               C      C
        75+        A    B
          -            B
          -    A
          -
          -
            ------+---------+---------+---------+---------+---------+nat-IQ  
                 72        84        96       108       120       132
 
 MTB > # A = low-SES
 MTB > # B = med-SES
 MTB > # C = hi=SES

 MTB > # First, let's explore SES effects with a 1-way ANOVA style analysis.
 MTB > #
 MTB > # We want to see whether the means of the foster children change with
 MTB > # SES.  The two models to compare are
 MTB > #
 MTB > #	H_0: one mean for all three SES's
 MTB > #	H_1: three different means in the three SES's
 MTB > #
 MTB > # As models, this is
 MTB > #
 MTB > #	H_0: y_{i} = b_0 (G_{i1} + G_{i2} + G_{i3}) + eps
 MTB > #	H_1: y_{i} = b_1 G_{i1} + b_2 G_{i2} + b_3 G_{i3} + eps
 MTB > #
 MTB > # (where G_{i1} is "hi-SES" for each twin pair, G_{i2} is "med-SES"
 MTB > # and G_{i3} is "low-SES")
 MTB > #
 MTB > # Note that neither model has an intercept...
 MTB > #
 MTB > name c10 'sum-SES'
 MTB > let 'sum-SES' = 'hi-SES' + 'med-SES' + 'low-SES'
 MTB > print 'fos-IQ' 'hi-SES' 'med-SES' 'low-SES' 'sum-SES'
 
  ROW  fos-IQ  hi-SES  med-SES  low-SES  sum-SES
 
    1      82       1        0        0        1
    2      80       1        0        0        1
    3      88       1        0        0        1
    4     108       1        0        0        1
    5     116       1        0        0        1
    6     117       1        0        0        1
    7     132       1        0        0        1
    8      71       0        1        0        1
    9      75       0        1        0        1
   10      93       0        1        0        1
   11      95       0        1        0        1
   12      88       0        1        0        1
   13     111       0        1        0        1
   14      63       0        0        1        1
   15      77       0        0        1        1
   16      86       0        0        1        1
   17      83       0        0        1        1
   18      93       0        0        1        1
   19      97       0        0        1        1
   20      87       0        0        1        1
   21      94       0        0        1        1
   22      96       0        0        1        1
   23     112       0        0        1        1
   24     113       0        0        1        1
   25     106       0        0        1        1
   26     107       0        0        1        1
   27      98       0        0        1        1
 
 MTB > # larger model (H1)
 MTB > regress 'fos-IQ' on 3 'hi-SES' 'med-SES' 'low-SES' ;
 SUBC> noconstant.
 
 The regression equation is
 fos-IQ = 103 hi-SES + 88.8 med-SES + 93.7 low-SES
 
 Predictor       Coef       Stdev    t-ratio        p
 Noconstant
 hi-SES       103.286       5.973      17.29    0.000
 med-SES       88.833       6.451      13.77    0.000
 low-SES       93.714       4.223      22.19    0.000
 
 s = 15.80
 Analysis of Variance
 
 SOURCE       DF          SS          MS         F        p
 Regression    3      244977       81659    327.01    0.000
 Error        24        5993         250
 Total        27      250970
 
 SOURCE       DF      SEQ SS
 hi-SES        1       74676
 med-SES       1       47348
 low-SES       1      122953
 Unusual Observations
 Obs.  hi-SES    fos-IQ       Fit Stdev.Fit  Residual   St.Resid
  14     0.00     63.00     93.71      4.22    -30.71     -2.02R 
 
 R denotes an obs. with a large st. resid.
 
 MTB > # smaller model (H0)
 MTB > regress 'fos-IQ' on 1 'sum-SES' ;
 SUBC> noconstant.
 
 The regression equation is
 fos-IQ = 95.1 sum-SES
 
 Predictor       Coef       Stdev    t-ratio        p
 Noconstant
 sum-SES       95.111       3.095      30.73    0.000
 
 s = 16.08
 Analysis of Variance
 
 SOURCE       DF          SS          MS         F        p
 Regression    1      244245      244245    944.34    0.000
 Error        26        6725         259
 Total        27      250970
 
 Unusual Observations
 Obs. sum-SES    fos-IQ       Fit Stdev.Fit  Residual   St.Resid
   7     1.00    132.00     95.11      3.10     36.89      2.34R 
  14     1.00     63.00     95.11      3.10    -32.11     -2.03R 
 
 R denotes an obs. with a large st. resid.
 * NOTE  * All values in column are identical
 
 MTB > # the F-statistic
 MTB > # (RSS0-RSS1)/(df1-df0) / RSS1/(n-df1)
 MTB > #
 MTB > let k1 = (6725-5993)/(3-1) / (5993/(27-3))
 MTB > print k1  # this is F(2,24)
 K1       1.46571
 MTB > # We find that P[F(2,24)>=1.46571] = 0.25, so we would not
 MTB > # reject H0 (a common mean). SES of the natural parents doesn't 
 MTB > # much affect IQ of the twin raised in the foster home.
 MTB >  
 MTB > # A two-way ANOVA comparing the effect of SES on foster-raised
 MTB > # twin with the effect of SES on natural-raised twin could be
 MTB > # carried out by
 MTB > #
 MTB > #	1. "stacking" the data
 MTB > #	2. treating both 'fos-IQ' and 'nat-IQ' as y-var's
 MTB > #	3. creating a new dummy variable that is 1 for foster-
 MTB > #	   raised twin and 0 for the natural-raised twin
 MTB > #
 MTB > #	(why only one new dummy and not two?)
 MTB > #
 MTB > # However, we will not pursue the 2-way ANOVA.
 MTB >  
 MTB >  
 MTB >  
 MTB > # Let's turn to a different question.  How well does the IQ of the
 MTB > # natural-raised twin predict the IQ of the foster-raised twin, and
 MTB > # does SES affect this prediction?
 MTB > #
 MTB > # The simplest (most restrictive) model is just simple linear 
 MTB > # regression predicting 'fos-IQ' from 'nat-IQ'.  Here we go:
 MTB > regress 'fos-IQ' on 1 'nat-IQ'
 
 The regression equation is
 fos-IQ = 9.21 + 0.901 nat-IQ
 
 Predictor       Coef       Stdev    t-ratio        p
 Constant       9.208       9.300       0.99    0.332
 nat-IQ       0.90144     0.09633       9.36    0.000
 
 s = 7.729       R-sq = 77.8%     R-sq(adj) = 76.9%
 
 Analysis of Variance
 
 SOURCE       DF          SS          MS         F        p
 Regression    1      5231.1      5231.1     87.56    0.000
 Error        25      1493.5        59.7
 Total        26      6724.7
 
 Unusual Observations
 Obs.  nat-IQ    fos-IQ       Fit Stdev.Fit  Residual   St.Resid
   7      131    132.00    127.30      3.75      4.70      0.70 X
  23       97    112.00     96.65      1.50     15.35      2.02R 
  24       97    113.00     96.65      1.50     16.35      2.16R 
 R denotes an obs. with a large st. resid.
 X denotes an obs. whose X value gives it large influence.
 
 MTB > # Now let's examine the simple regression model for variations among
 MTB > # the three SES groups.  There are 4 models that are commonly
 MTB > # considered.  We will list them in order from most general to
 MTB > # most restrictive.  They are:
 MTB > #
 MTB > # 1. MOST GENERAL: Each of the three SES groups has its own slope and
 MTB > #    intercept parameters: think of three randomly-dropped toothpicks.
 MTB >
 MTB > # 2. PARALLEL REGRESSIONS: Each of the three SES groups has the same
 MTB > #    slope, but different intercepts.  Think of three parallel tooth-
 MTB > #    picks.
 MTB > #
 MTB > # 3. CONCURRENT REGRESSIONS: The three SES groups have different
 MTB > #    slopes, but they intersect at a common point.  Usually this
 MTB > #    point is on the y-axis (same intercept), but by subtracting
 MTB > #    (or adding) a constant from the X-values the common point
 MTB > #    could be moved to some other location.  Think of three tooth-
 MTB > #    picks connected at one end and emanating in three directions.
 MTB > #
 MTB > # 4. COINCIDENT REGRESSIONS: The three regression lines are the
 MTB > #    same for all three SES groups.  This is the simple regression
 MTB > #    we fit above.  (Now the three toothpicks occupy the same space.)
 MTB > #
 MTB > #
 MTB > #
 MTB > # There are two kinds of comparisons that would be common here.
 MTB > #
 MTB > # (a) compare 2, 3, and 4 with 1
 MTB > # (b) compare 4 against 2 (this is ANCOVA... more later!)
 MTB > #
 MTB >  
 MTB >  
 MTB > # To get different slopes for each group, we need to have variables
 MTB > # that are the 'nat-IQ' for twin pairs within one group (say, low-SES)
 MTB > # but are 0 for twins outside that SES group.  So we need a new set
 MTB > # of variables.  We define...
 MTB > name c6 'hi-nat' c7 'med-nat' c8 'low-nat'
 MTB > let 'hi-nat' = 'nat-IQ' * 'hi-SES'
 MTB > let 'med-nat' = 'nat-IQ' * 'med-SES'
 MTB > let 'lo-nat' = 'nat-IQ' * 'low-SES'
 MTB > let 'low-nat' = 'nat-IQ' * 'low-SES'
 MTB > print 'fos-IQ' 'nat-IQ' 'hi-SES'-'low-nat'
 
  ROW  fos-IQ  nat-IQ  hi-SES  med-SES  low-SES  hi-nat  med-nat  low-nat
 
    1      82      82       1        0        0      82        0        0
    2      80      90       1        0        0      90        0        0
    3      88      91       1        0        0      91        0        0
    4     108     115       1        0        0     115        0        0
    5     116     115       1        0        0     115        0        0
    6     117     129       1        0        0     129        0        0
    7     132     131       1        0        0     131        0        0
    8      71      78       0        1        0       0       78        0
    9      75      79       0        1        0       0       79        0
   10      93      82       0        1        0       0       82        0
   11      95      97       0        1        0       0       97        0
   12      88     100       0        1        0       0      100        0
   13     111     107       0        1        0       0      107        0
   14      63      68       0        0        1       0        0       68
   15      77      73       0        0        1       0        0       73
				       (etc.)

 MTB > # Now let's fit the four models.
 MTB > #
 MTB >  
 MTB > # Model 1: 3 DIFFERENT REGRESSIONS (no overall intercept!)
 MTB > #
 MTB > regress 'fos-IQ' on 6 'hi-SES'-'low-nat' ;
 SUBC> noconstant.
 
 The regression equation is
 fos-IQ = - 1.9 hi-SES + 0.8 med-SES + 7.2 low-SES + 0.978 hi-nat
            + 0.973 med-nat + 0.948 low-nat
 
 Predictor       Coef       Stdev    t-ratio        p
 Noconstant
 hi-SES         -1.87       17.81      -0.11    0.917
 med-SES         0.82       26.11       0.03    0.975
 low-SES         7.20       16.75       0.43    0.672
 hi-nat        0.9776      0.1632       5.99    0.000
 med-nat       0.9726      0.2863       3.40    0.003
 low-nat       0.9484      0.1822       5.21    0.000
 
 s = 7.921
 Analysis of Variance
 
 SOURCE       DF          SS          MS         F        p
 Regression    6      249653       41609    663.23    0.000
 Error        21        1317          63
 Total        27      250970
 
 SOURCE       DF      SEQ SS
 hi-SES        1       74676
 med-SES       1       47348
 low-SES       1      122953
 hi-nat        1        2251
 med-nat       1         724
 low-nat       1        1700
 
 Unusual Observations
 Obs.  hi-SES    fos-IQ       Fit Stdev.Fit  Residual   St.Resid
  27     0.00     98.00    112.48      4.18    -14.48     -2.15R 
 
 R denotes an obs. with a large st. resid.

 MTB > # Model 2: PARALLEL REGRESSIONS.  No overall intercept, but
 MTB > # use the overall 'nat-IQ' variable to generate an overall slope.
 MTB > #
 MTB > regress 'fos-IQ' on 4 'hi-SES'-'low-SES' 'nat-IQ' ;
 SUBC> noconst.
 
 The regression equation is
 fos-IQ = - 0.6 hi-SES + 1.4 med-SES + 5.62 low-SES + 0.966 nat-IQ
 
 Predictor       Coef       Stdev    t-ratio        p
 Noconstant
 hi-SES         -0.61       11.86      -0.05    0.960
 med-SES         1.43       10.16       0.14    0.889
 low-SES        5.619       9.963       0.56    0.578
 nat-IQ        0.9658      0.1069       9.03    0.000
 
 s = 7.571
 Analysis of Variance
 
 SOURCE       DF          SS          MS         F        p
 Regression    4      249652       62413   1088.81    0.000
 Error        23        1318          57
 Total        27      250970
 
 SOURCE       DF      SEQ SS
 hi-SES        1       74676
 med-SES       1       47348
 low-SES       1      122953
 nat-IQ        1        4675
 
 Unusual Observations
 Obs.  hi-SES    fos-IQ       Fit Stdev.Fit  Residual   St.Resid
  27     0.00     98.00    112.82      2.93    -14.82     -2.12R 
 
 R denotes an obs. with a large st. resid.
 
 MTB > # Model 3: COMMON INTERCEPT, different slopes.  Now we let MINTAB
 MTB > # generate the intercept for us...
 MTB > #
 MTB > regress 'fos-IQ' on 3 'hi-nat'-'low-nat'
 
 The regression equation is
 fos-IQ = 2.6 + 0.938 hi-nat + 0.954 med-nat + 0.999 low-nat
 
 Predictor       Coef       Stdev    t-ratio        p
 Constant        2.56       10.60       0.24    0.811
 hi-nat       0.93751     0.09929       9.44    0.000
 med-nat       0.9536      0.1202       7.93    0.000
 low-nat       0.9985      0.1164       8.57    0.000
 
 s = 7.594       R-sq = 80.3%     R-sq(adj) = 77.7%
 
 Analysis of Variance
 
 SOURCE       DF          SS          MS         F        p
 Regression    3      5398.2      1799.4     31.20    0.000
 Error        23      1326.5        57.7
 Total        26      6724.7
 
 SOURCE       DF      SEQ SS
 hi-nat        1      1147.3
 med-nat       1        10.5
 low-nat       1      4240.3
 
 Unusual Observations
 Obs.  hi-nat    fos-IQ       Fit Stdev.Fit  Residual   St.Resid
  27        0     98.00    113.40      3.22    -15.40     -2.24R 
 
 R denotes an obs. with a large st. resid.
 
 MTB > # Model 4: SAME REGRESSION for all three groups.  We did this above,
 MTB > # but let's do it again.
 MTB > #
 MTB > regress 'fos-IQ' on 1 'nat-IQ'
 
 The regression equation is
 fos-IQ = 9.21 + 0.901 nat-IQ
 
 Predictor       Coef       Stdev    t-ratio        p
 Constant       9.208       9.300       0.99    0.332
 nat-IQ       0.90144     0.09633       9.36    0.000
 
 s = 7.729       R-sq = 77.8%     R-sq(adj) = 76.9%
 
 Analysis of Variance
 
 SOURCE       DF          SS          MS         F        p
 Regression    1      5231.1      5231.1     87.56    0.000
 Error        25      1493.5        59.7
 Total        26      6724.7
 
 Unusual Observations
 Obs.  nat-IQ    fos-IQ       Fit Stdev.Fit  Residual   St.Resid
   7      131    132.00    127.30      3.75      4.70      0.70 X
  23       97    112.00     96.65      1.50     15.35      2.02R 
  24       97    113.00     96.65      1.50     16.35      2.16R 
 R denotes an obs. with a large st. resid.
 X denotes an obs. whose X value gives it large influence.
 
 MTB >  
 MTB >  
 MTB > # Now let's do the first set of comparisons...
 MTB >  
 MTB > # 2 (PARALLEL) vs 1 (THREE REGRESSIONS):
 MTB > let k1 = (1318.4-1317)/(6-4) / ( 1317/(27-6) )
 MTB > print k1
 K1       0.0111619
 MTB >  
 MTB > # 3 (CONCURRENT [SAME INTERCEPT]) vs 1 (THREE REGRESSIONS):
 MTB > let k1 = (1326.5-1317)/(6-4) / ( 1317/(27-6) )
 MTB > print k1
 K1       0.0757403
 MTB >  
 MTB > # 4 (IDENTICAL REGRESSIONS) vs 1 (THREE REGRESSIONS):
 MTB > let k1 = (1493.5-1417)/(6-2) / ( 1317/(27-6) )
 MTB > print k1
 K1       0.304954
 MTB >  
 MTB > # If anything, there's evidence of overfit here!  Remember, each
 MTB > # F statistic is usually bigger than 1; here all the F's are less
 MTB > # than 1...
 MTB >  
 MTB >  
 MTB >  
 MTB >  
 MTB > # Now, let's look at the second comparison: model 4 vs model 2.
 MTB > # This is exactly like our 1-way ANOVA from before but now the
 MTB > # SES means (under H1) and the overal means (under H0) are
 MTB > # corrected for the predictive quality of the "covariate"
 MTB > # 'nat-IQ'.  This is usually called the "analysis of covariance"
 MTB > # or ANCOVA...
 MTB > #
 MTB > # to be explicit, the two hypotheses are:
 MTB > #
 MTB > #	H0: y_i = b0 + b4 'nat-IQ' + eps
 MTB > #	H1: y_i = b1 G_{i1} + b2 G_{i2} + b3 G_{i3} 
 MTB > #		 			+ b4 'nat-IQ' + eps
 MTB > #
 MTB > # (NOTE: Since the simple ANOVA failed to detect anything, it'd be
 MTB > # somewhat surprising if the ANCOVA detected anything.  Usually the
 MTB > # effect of including the covariate is to decrese differences between
 MTB > # the cell means in an ANOVA)
 MTB > #
 MTB > # Anyway, here goes the test of 4 (H0) versus 2 (H1):
 MTB > #
 MTB > let k1 = (1493.5-1318.4)/(4-2) / ( 1318.4/(27-4) )
 MTB > print k1
 K1       1.52734
 MTB > # p[F(2,23)>=1.52734] = 0.24, so again don't reject simpler (more
 MTB > # restrictive) model...
 MTB > nooutfile
