Bacteria example   Log transformation of y

Bacteria were exposed to x-rays for various time periods and the number
of survivors was counted.  In this case x is the time exposed and y is 
the number (in hundreds) remaining alive.

 MTB > name c1 'time'
 MTB > name c2 'number'
 MTB > plot c2 c1
 
          -
       360+ *
          -
  number  -
          -
          -
       240+
          -     *
          -         *
          -             *
          -                 *
       120+
          -                     *   *
          -                             *
          -                                 *   *   *
          -                                             *   *   *   *
         0+
            ------+---------+---------+---------+---------+---------+time    
                2.5       5.0       7.5      10.0      12.5      15.0

Note the curvature in the scatter plot.

 MTB > regress c2 on 1 in c1 c3 c4
 
 The regression equation is
 number = 260 - 19.5 time
 
 Predictor       Coef       Stdev    t-ratio        p
 Constant      259.58       22.73      11.42    0.000
 time         -19.464       2.500      -7.79    0.000
 
 s = 41.83       R-sq = 82.3%     R-sq(adj) = 81.0%
 
 Analysis of Variance
 
 SOURCE       DF          SS          MS         F        p
 Regression    1      106080      106080     60.62    0.000
 Error        13       22749        1750
 Total        14      128830
 
 Unusual Observations
 Obs.    time    number       Fit Stdev.Fit  Residual   St.Resid
   1      1.0     355.0     240.1      20.6     114.9      3.15R 
 
 R denotes an obs. with a large st. resid.
 MTB > plot c3 c4
 
          -                                                         *
       3.0+
          -
  C3      -
          -
          -
       1.5+
          -   *
          -      *
          -
          -          *   *
       0.0+                                                 *
          -                  *                          *       *
          -                      *   *       *      *
          -                                      *
          -                              *
      -1.5+
            --------+---------+---------+---------+---------+--------C4      
                    0        50       100       150       200

	The residual plot is not satisfactory.  It is bowl shaped, indicating
that a straight line model is not appropriate.



    Now let's transform y .  We will use log y instead of y in our regression
equation.
      
 MTB > logt c2 c32
 MTB > name c32 'log y'


 MTB > plot c32 c1
 
          - *
      2.50+
          -
  log y   -     *   *
          -             *   *
          -
      2.00+                     *   *
          -
          -                             *
          -                                 *
          -                                     *   *
      1.50+                                             *
          -
          -                                                 *   *
          -                                                         *
          -
      1.00+
            ------+---------+---------+---------+---------+---------+time    
                2.5       5.0       7.5      10.0      12.5      15.0
 

 MTB > regress c32 on 1 in c1 c35 c36
 
 The regression equation is
 log y = 2.59 - 0.0949 time
 
 Predictor       Coef       Stdev    t-ratio        p
 Constant     2.59411     0.02596      99.92    0.000
 time       -0.094861    0.002855     -33.22    0.000
 
 s = 0.04778     R-sq = 98.8%     R-sq(adj) = 98.7%
 
 Analysis of Variance
 
 SOURCE       DF          SS          MS         F        p
 Regression    1      2.5196      2.5196   1103.70    0.000
 Error        13      0.0297      0.0023
 Total        14      2.5493
 
 
 
 MTB > plot c35 c36
 
  C35     -                                  *
          -
          -
       1.2+               *                                         *
          -
          -                                          *
          -
          -        *          *       *                  *
       0.0+    *                                 *
          -                                                 *
          -
          -
          -           *
      -1.2+                              *
          -                       *
          -
          -                                                     *
            ------+---------+---------+---------+---------+---------+C36     
               1.25      1.50      1.75      2.00      2.25      2.50

This is a satisfactory residual plot.  It indicates that the model with
log y fits the data better than the model with y i.e. The relationship
between x and y is represented better by a curve than a straight line. 

The model is predicting log y. To get back to y, use the antilog command.

 MTB > antilog c36 c37
 MTB > print c2 c4 c36 c37
 (Here y = c2,c4 = predicted y using the straight line model, c36 = predicted
log y and c37 = predicted y using the model with log y.)

  ROW  number        C4       C36       C37
 
    1     355   240.117   2.49925   315.682
    2     211   220.652   2.40439   253.740
    3     197   201.188   2.30953   203.952
    4     166   181.724   2.21467   163.933
    5     142   162.260   2.11981   131.767
    6     106   142.795   2.02495   105.912
    7     104   123.331   1.93008    85.130
    8      60   103.867   1.83522    68.426
    9      56    84.402   1.74036    55.000
   10      38    64.938   1.64550    44.208
   11      36    45.474   1.55064    35.534
   12      32    26.010   1.45578    28.561
   13      21     6.545   1.36092    22.957
   14      19   -12.919   1.26606    18.453
   15      15   -32.383   1.17120    14.832
 
 If you plotted the values for c4 and c37 on the scatterplot you would find
that the values in c4 fall on a straight line which does not represent the
data well; for example, at times 14 and 15 negative values are predicted.
The values in c37 fall on a curve which fits the data well.




If you are confused about the commands for log and antilog, this little
example may help
The y values are contained in column 2
If we use the command logt c2 c32, c32 now contains the log to the base 10
of each value in c2.
To get back to the original values (or to undo the log command)in Minitab
   MTB > antilog c32 c33  C33 now has the original y values

 MTB > print c2 c32 c33

  ROW  number     log y    C33

    1     355   2.55023    355
    2     211   2.32428    211
    3     197   2.29447    197
    4     166   2.22011    166
    5     142   2.15229    142
    6     106   2.02531    106
    7     104   2.01703    104
    8      60   1.77815     60
    9      56   1.74819     56
   10      38   1.57978     38
   11      36   1.55630     36
   12      32   1.50515     32
   13      21   1.32222     21
   14      19   1.27875     19
   15      15   1.17609     15
