close all
% The Prostate Cancer clinical trial data of Byar and Green (1980) is 
% reproduced in Andrews and Herzberg (1985, pp 261-247). It is also 
% available in Statlib at the URL 
% 
% http://lib.stat.cmu.edu/datasets/Andrews/T46.1
% 
% 
% This data set was obtained from a randomized clinical trial comparing 
% four treatments for 506 patients with prostatic cancer. These patients 
% had been grouped by physicians using clinical criteria into Stage 3 
% and Stage 4 of the disease. This is response variable, in column 13.
% 
% 
% There are twelve pre-trial covariates measured on each patient, seven 
% may be taken to be continuous, four to be discrete, and one variable 
% (Index of tumour stage and histolic grade) is an index nearly all of 
% whose values lie between 7 and 15, and which could be considered either 
% discrete or continuous. 
% 
% In column order, the covariates are:
% 
% Age, Weight, Performance rating, Cardiovascular disease history, 
% Systolic Blood pressure,  Diastolic blood pressure, 
% Electrocardiogram code, Serum haemoglobin,  Size of primary tumour, 
% Index of tumour stage and histolic grade,  
% Serum prostatic acid phosphatase.  
% 
% Continuous covariates:
% Age, Weight, Systolic Blood pressure, Diastolic blood pressure,
% Serum haemoglobin, Size of primary tumour,
% Index of tumour stage and histolic grade,
% Serum prostatic acid phosphatase
% 
% Categorical covariates (Number of Levels):
% Performance rating (4), Cardiovascular disease history (2),
% Electrocardiogram code (7), Bone metastases (2) 
% 
% A preliminary inspection of the data showed that the size of the 
% primary tumour (SZ) and serum prostatic acid phosphatase (AP) were both 
% skewed variables. These variables have therefore been transformed. A
% square root transformation was used for SZ, and a logarithmic
% transformation was used for AP to achieve approximate normality. 
% Observations that had missing values in any of the twelve pretreatment 
% covariates were omitted from further analysis, leaving 475 out of the 
% original 506 observations available. The original
% numbering is given in column 14.

prostatecanc =[...
  75   76  0  0  15   9  4  138   2   8     3  0  3    1
  69  102  0  1  14   8  4  134   3   9     3  0  3    3
  75   94  1  1  14   7  1  176   4   8     9  0  3    4
  67   99  0  0  17  10  0  134  34   8     5  0  3    5
  71   98  0  0  19  10  0  151  10  11     6  0  3    6
  75  100  0  0  14  10  1  130  13   9     8  0  3    7
  73  114  0  1  17  11  4  126   3   9     6  0  3    8
  60  110  0  0  12   8  0  146   4  10     7  0  3    9
  78  107  0  1  13   8  5  130  21   6     4  0  3   10
  77   89  0  0  15   8  0  156   3   8     6  0  3   11
  74  105  0  1  18  14  0  136   6   8     4  0  3   12
  74  107  0  0  14   9  5  144   6   9     3  0  3   13
  55  112  0  1  16   9  4  139   4   9    10  0  3   14
  73   88  0  0  19  10  4  120  15  10     6  0  3   15
  87   81  1  1  17  12  2  134   3   9     4  0  3   16
  64   90  0  0  14   8  0  162   6   9     7  0  3   17
  79  104  0  0  13   8  1  150   5   8     5  0  3   18
  62   90  0  1  13   8  1  144   2   9     7  0  3   19
  74  107  0  0  13   8  4  164  10   9     7  0  3   20
  83   72  1  1  13   9  4  150   1  10     7  0  3   21
  65  113  0  0  16  10  0  141  21   9     7  0  3   22
  61   97  0  0  11   8  0  135   8   8     6  0  3   23
  56   95  0  0  15  10  2  148  26  13   357  1  4   24
  73  103  0  0  16  10  0  146   6  11    39  0  4   25
  69   75  0  0  16   8  4  107  25  11    62  0  4   26
  76   82  0  0  12   8  5  117  12  10    25  0  4   27
  71  103  0  0  12   7  0  144  11  11   120  0  4   28
  66  126  0  0  17  10  4  140  32  13   242  0  4   29
  76   90  0  0  15   9  4  128  40  13    23  0  4   30
  74   77  2  0  16   9  4  105  17  13  3160  1  4   31
  71  150  0  1  16  10  5  150   9  11    19  0  4   32
  71   88  0  1  16   9  4  123  38  13   354  0  4   33
  79   89  0  0  16   9  4  128  26  12   121  0  4   34
  75  101  0  0  15   9  0  146   8  14    38  0  4   35
  76   86  0  1  16   6  4   82  10  11   992  1  4   36
  72   93  0  0  16  10  4  130   2  11    13  0  4   37
  69   84  0  1  12   8  1  104  15  13   289  1  4   38
  53   99  0  0  12   9  1  142  26  13    56  1  4   39
  76   85  0  0  14   9  4  130   6  11    14  1  4   40
  72   95  0  1  17   8  4  136  12  12    23  0  4   41
  82   89  0  0  14   8  0  130  27  13   223  1  4   43
  74  124  0  0  16   8  3   94  26  15    13  0  4   44
  75   93  0  0  13   9  2  153  16  13    33  0  4   45
  74   81  0  0  17  10  4  134  28  11   200  1  4   46
  60   96  0  0  12   8  0  143  27  13    70  0  4   47
  49   99  0  0  13   7  0  148  14   8     5  0  3   49
  74   96  1  1  11   6  5  104  20  11     6  0  3   50
  73  101  0  0  16   7  0  124  18  11     6  0  3   51
  76   98  0  1  17  10  5  171  13   8     5  0  3   52
  72   84  0  1  12   8  4  148  15   8     6  0  3   53
  73   82  0  1  16   8  4  141  20   9     5  0  3   54
  78  108  2  1  18   8  5  148  24   9     3  0  3   55
  71  112  0  1  15   9  0  132  14  11     4  0  3   56
  64  130  0  0  13   9  0  142  23  11     2  0  3   58
  78  118  0  1  16   9  4  124   3   9     4  0  3   59
  60   99  0  0  12   9  0  136   7   9     6  0  3   60
  68  104  0  0  14   9  4  144  32  13    73  1  4   61
  77   93  1  0  21   9  5  129  24  13   117  0  4   62
  73  102  0  1  14   9  4  120  51  15    87  0  4   63
  70   76  2  0  12   8  0   78  26  11    20  1  4   64
  53  106  0  0  14   8  4  143  10  11     7  0  4   65
  55  116  0  0  13   9  4  148  26  15    46  1  4   66
  80   91  1  1  14   8  5  117  15  13    13  0  4   67
  59   71  0  0   8   4  4   87  27  11  1751  1  4   68
  80  111  0  0  16   9  0  113  34  15    11  1  4   69
  68   97  1  1  14   8  5  121  18   8     6  0  3   70
  77  103  0  1  13   7  2  144   5   9     7  0  3   71
  74  110  0  0  16   8  1  136   7   8     5  0  3   72
  70   94  0  0  15   7  1  137  24   7     8  0  3   73
  65   90  0  0  14   8  0  140  47   9     3  0  3   75
  74   97  0  1  13   7  0  129   6   8     2  0  3   76
  72  110  0  1  22  13  5  147   5  10     6  0  3   77
  69   97  0  1  13   7  0  143   4   9     3  0  3   78
  72  115  0  1  16  10  0  120   5   8     3  0  3   79
  71   87  0  1  13  10  2  134  13   9     8  0  3   80
  73   93  0  0  11   7  0  138   8   9     3  0  3   81
  79  106  0  1  16   7  5  136  13   9     2  0  3   82
  63   86  0  1  16   8  5  160   7   9     4  0  3   83
  74  101  0  1  14   9  2  106  14   8     4  0  3   84
  72  118  0  1  17  11  0  156   9   9     6  0  3   85
  78  117  0  1  10   7  4  136  16   8     4  0  3   86
  76   92  0  1  12   7  5  136  12   9     5  0  3   87
  70   72  0  1  16   9  3  120  17   8     1  0  3   88
  69  120  0  1  16  10  4  136  21  10     7  0  3   89
  76  102  0  1  12   8  0  132  13   8     5  0  3   90
  84  104  0  1  15  10  1  134   8   6     4  0  3   91
  80   98  0  1  15   8  0  123   8   9     5  0  3   92
  81   97  0  0  10   7  0  134  11   9     7  0  3   93
  81   76  0  1  13   7  4  149  28   9     5  0  3   94
  71  100  0  1  12  10  4  144  11   6     3  0  3   95
  77  109  0  0  14   7  0  120   7  10     3  0  3   96
  70  109  0  1  18   8  4  120  28   9     5  0  3   97
  76  108  0  1  12   7  5  120   3   9     3  0  3   98
  76  102  0  1  16   9  5  182  52  11     6  0  3   99
  71   97  0  0  13   7  3  134  19   9     6  0  3  100
  76   96  0  1  17   8  0  137  33   9     6  0  3  101
  64  100  0  1  16  10  0  137   6   9     2  0  3  102
  74  113  0  0  12   7  0  143   7  10     8  0  3  103
  76   88  0  1  16   9  0  123   3   8     6  0  3  104
  82   82  0  1  13   9  2  116   5  10     6  0  3  105
  65   87  0  1  16   8  0  145   2   9     8  0  3  106
  70   83  1  0  14   6  0  127  14  11    97  1  4  107
  76   92  0  0  13   6  4   97   6  10    62  1  4  108
  77   93  0  0  10   6  1  110   0  12    49  0  4  109
  77   99  0  1  17   9  0  128  15  12    24  0  4  110
  70  103  0  1  12   7  0  135  23  11   102  0  4  111
  73   80  0  1  13   8  4  129  61  12   397  0  4  112
  63  119  0  1  13   8  4  128  14  15   417  1  4  113
  71   91  0  0  13   6  4  120   1  10    12  0  4  114
  78  103  1  1  14   8  0  100  38  12    18  1  4  115
  74  100  0  1  13   8  5  144   1  11    11  0  4  116
  70  110  0  1  16   8  5  159   4  10    20  0  4  117
  73  106  0  1  11   8  1  112  10  13    12  1  4  118
  74   98  0  1  13   6  2  140  41  12   784  1  4  119
  77   91  0  1  12   7  4  143   6  11    17  1  4  120
  85   85  0  1  15   7  0  140  12  12   259  0  4  121
  72   79  0  1  13   7  0  123  16   9     8  0  3  122
  78   83  0  0  13   7  0  103  25  11     5  0  3  124
  72   76  0  0  11   9  1  100  16  10     7  0  3  126
  68  124  0  0  13   7  2  145  17   9    18  0  3  127
  71   93  0  0  15   9  0  145  19   9     3  0  3  128
  65  125  0  0  17   9  5  150  19   8     8  0  3  129
  67   96  0  0  13   7  5  157   7   9     5  0  3  130
  74   98  0  0  15   9  3  142   3  12    41  0  3  132
  78   91  0  0  11   7  0  110   4   9     3  0  3  133
  74   85  0  0  14   8  1  140  16   9     9  0  3  134
  71   92  0  0  13   7  3  140   9   9     8  0  3  135
  74  113  0  0  14   7  2  105  20   9     5  0  3  136
  72  110  0  0  17  10  4  145  20   8     4  0  3  137
  57   97  0  0  14   8  4  147  20   9     7  0  3  138
  74  104  0  0  14   7  0  138  25   8     8  0  3  139
  72  105  0  0  12   6  2  136   5   9     7  0  3  140
  65   99  0  0  13   8  0  144  10   9     6  0  3  141
  83  115  0  0  17   9  4  167  25   9     6  0  3  142
  71   98  2  1  18   9  4  123  34  13   429  1  4  143
  73  103  0  0  12   8  0  128  21  11    28  0  4  144
  71  102  0  0  14   7  0  105  30  13  3670  1  4  145
  75  124  0  0  18  11  4  156  22  11    70  0  4  146
  71   77  0  0  10   6  2   70  17  13    36  1  4  147
  56   69  0  0  13   8  0  107  11  13    14  1  4  148
  83   88  0  0  13   7  0  133  15  13   217  0  4  149
  71  116  0  0  15   8  4  150  46  10    32  0  4  150
  73   98  1  1  15   8  2  102  23  13  1278  0  4  151
  78   74  0  0  12   9  4  140  32  11    47  1  4  152
  50  109  0  0  12   8  0   93  17  11  2252  1  4  153
  73  101  0  0  16  11  4  140   9  11    27  0  4  154
  67  111  0  0  12   9  5   96  17  11    70  1  4  155
  72   96  0  0  15   9  0  153   2  15   436  1  4  156
  72   96  0  0  14  10  1  105  26  12   299  1  4  157
  78  116  0  0  15  10  4  157   6  13    11  0  4  159
  72   91  0  1  19   9  4  120  16   8     6  0  3  160
  76  118  0  1  18   8  4  145   4   8     7  0  3  161
  77  111  0  0  19   9  3  125  20   9     8  0  3  162
  70  127  0  0  13   9  2  118  14   8     2  0  3  163
  74   96  0  1  10   7  0  102  18   9     9  0  3  164
  71   92  0  1  15   8  5  106   5   8     4  0  3  165
  69   89  0  1  12   7  0  135   4   8     5  0  3  166
  70  111  0  1  18   8  2   82  22   9     8  0  3  167
  58   99  0  0  19  12  4  131  24  11    16  0  4  168
  73  105  0  1  14   6  5  138   9  15    51  0  4  170
  69  108  0  0  12   8  0  122  23  11    20  0  4  171
  73   94  0  0  12   7  5  134  31  13    34  0  4  172
  73   93  0  0  14   8  0   78  23  15    12  0  4  173
  68  100  0  0  17  10  4  117  32  13   264  0  4  174
  75   88  0  1  14   6  0  134  31  13   216  1  4  175
  68  104  0  1  17  10  5  150  25  10     9  1  4  176
  76   88  0  1  16   7  0  112  32  13   262  0  4  177
  76   87  1  1  14   5  4  117  28  14   428  1  4  178
  75   89  0  1  14   8  0  126   8  11    20  0  4  179
  59  116  0  1  10   6  0  128   6  11    24  0  4  180
  72   96  0  0  11   8  0  103   9  11    33  1  3  181
  80   91  0  0  15   8  2  123   4   8     6  0  3  182
  78  112  0  1  16   8  0  150   7   9     3  0  3  183
  52   90  0  1  13   8  4  148   4   9     3  0  3  184
  75   87  0  0   9   5  4  127   8   8    10  0  3  185
  67  109  0  1  14   8  0  140   3   9     8  0  3  186
  74  103  0  0  16   6  4  130   4   9     4  0  3  187
  79  107  1  1  23  10  4  116   2   9     2  0  3  188
  73   96  0  0  15  10  2  120   4   9     5  0  3  189
  75  113  2  0  12   7  4  135   1  13     7  0  3  190
  72   88  0  0  14   7  4  120   7  12   594  0  4  191
  55   96  0  1  15   9  4  103  12  11     2  0  4  192
  48  100  1  1  14  10  4  123   3  11    15  0  4  194
  75   88  0  1   9   5  4  140   1  11    48  0  4  195
  56   94  0  0  12   8  0  144   1  10    11  0  4  196
  70   86  0  0  14   9  4  144   4  11    12  0  4  197
  54   89  0  0  15   6  2  148   8  13    12  1  4  198
  87   82  0  0  14   7  0  110   3  15    21  1  4  199
  73   94  0  1  14   9  4  133  22   8     8  0  3  200
  76   94  0  0  16  10  0  107   8   9     6  0  3  201
  68  106  0  0  15   9  0  107  69  13     9  0  3  202
  70   97  0  1  17  10  2  138  10   9     6  0  3  203
  65   83  0  0  12   6  0  160   8   9     6  0  3  204
  79   95  0  0  14   8  4  134  11   9     4  0  3  205
  70  120  0  0  19  11  0  147   7   9     5  0  3  206
  70   99  0  0  12   8  0  160   8   9     6  0  3  207
  59   90  0  1  14   8  0  104   2   9     3  0  3  208
  72   73  2  0  13   8  0  142  11   8     6  0  3  209
  76   88  0  1  14   9  0  152   4   5     6  0  3  210
  78  123  0  0  13   8  1  168   0  10     9  0  3  211
  76  113  0  1  14   6  4  128   3   8     7  0  3  212
  66   87  0  0  14   9  0  143   3   8     4  0  3  213
  69   91  0  1  16  10  3  150  11   8     3  0  3  214
  71   88  0  0  16   8  4  154   3   9     5  0  3  215
  75  120  0  0  15   7  4  151   4   8     6  0  3  216
  74   99  0  1  17   9  2  157   7   7     6  0  3  217
  72  103  0  0  15   9  3  165   4  10    10  0  4  218
  78   96  2  0  16   9  4  101  54  12    46  1  4  219
  71  110  0  0  14   9  5  134   6  10     7  1  4  220
  75  101  0  1  16  10  4  110  15  10    16  0  4  221
  73   89  2  0  15   8  4   72  14  11   204  1  4  222
  79   79  2  0  15   7  1  133  16  13   289  1  4  223
  70   92  0  0  16   8  0  135  22  14    27  0  4  224
  73   76  0  0  17   8  0  134  50  13    89  0  4  225
  75   98  0  1  14   8  0  147  16  13    28  0  4  226
  76   83  0  0  12   6  2  114  13  11  5960  1  4  227
  71   77  1  0  17   7  5  118  61  15    43  1  4  228
  76   91  0  0  17   8  0  151  24  11    82  0  4  229
  73  106  0  1  16   9  0  147  11  11   369  0  4  230
  70   80  0  1  10   8  4  122   5  11    43  0  4  231
  72  100  0  1  12   7  5  160  62  11   548  1  4  232
  74  101  0  0  14   9  5  148  25  10    24  0  4  233
  62   98  0  0  12   8  4  156  15  13    45  0  4  234
  53  116  0  0  13   8  0  164   7  12    10  0  4  235
  54   91  0  0  13  10  0  130  15   9     7  0  3  236
  58   94  0  1  16  10  3  138  12   9     2  0  3  237
  78   99  0  1  17   9  5  120   9   8     1  0  3  238
  77  100  0  1  10   7  3  124  25   9     4  0  3  239
  61  152  0  1  15  10  4  141  18   7     2  0  3  240
  78   98  1  1  13   7  4  136   9   9     5  0  3  241
  68   88  1  1  24  12  4  144  12   9     2  0  3  242
  70  109  0  0  15  10  0  145  15  11     6  0  3  244
  75   81  0  0  16  10  0  137  19  10     5  0  3  245
  80   91  0  0  12   8  4  108  22  11     9  0  3  246
  76   99  0  1  13   8  5  112  20   8     5  0  3  247
  68  102  0  0  16   8  0  120  20  11     7  0  3  248
  73   81  0  1  19   4  4  125  18  11     3  0  3  249
  79   96  0  0  15  10  4  140  16   6     3  0  3  250
  78   81  0  1  14   7  5  110   4   9     4  0  3  251
  79   94  0  1  11   8  5  122   4   6     4  0  3  252
  72   90  1  1  22  12  4  123  15  14     5  1  4  253
  52  106  0  1  11   7  0  150  13  14    53  0  4  254
  76   97  0  1  15  10  4  146  19  11  3535  0  4  255
  74   85  0  0  16  10  2  100  19  13   139  1  4  256
  71   86  0  0  14   8  0  102   8  11     4  1  4  257
  72   96  0  0  14  10  2  123  17  12   200  0  4  258
  77  113  0  0  15   8  0  138  22  12    55  0  4  259
  73  100  0  1  16  10  4  138  23  11    97  0  4  260
  75   83  0  0  12   7  2  118  17  13    23  0  4  261
  71   98  0  0  15  10  4  147  12  11   431  1  4  263
  76   94  0  1  16   9  0  105  20  12   336  0  4  264
  49   90  1  0  14   8  4  141  21  15    56  1  4  265
  74   91  2  1  13   7  2  134  17  11  2783  1  4  266
  59   97  0  0  13   6  0  141  17  13    22  0  4  267
  79  116  0  1  15   9  2  126  23  11    38  0  4  268
  72   82  0  0  13   7  4   94  33  11     6  0  3  272
  58  136  1  1  14   8  1  105  30  12     7  0  3  273
  73  101  0  0  12   6  0  128  46  11     6  0  3  274
  75  113  0  1  19   8  5  109  21  11     4  0  3  275
  78  107  0  0  14   9  0  128  42  11   297  0  3  276
  60   94  0  0  15   9  0  130  10   9     4  0  3  277
  72   83  0  0  11   7  0  138  15   9     4  0  3  278
  59   99  3  0  13   8  0  127  17  13  9999  1  4  279
  74  107  0  1  15   8  0  146  18  11    84  0  4  281
  76   97  0  0  14   8  0  137  36  15   155  0  4  282
  80  135  0  1  11   7  5  129  17  11    38  0  4  283
  72  123  0  1  15   8  2  158   0  13    18  0  4  284
  74  111  0  0  13   8  0  152  25  13    42  0  4  286
  65  102  0  0  15   9  0  155  19  11    22  0  4  287
  71  119  0  0  19  10  4  136  24  13   256  1  4  288
  76   94  0  0  14   6  0  106  24  11   109  1  4  289
  74   74  3  0  14   5  3  112   2  11    37  1  4  290
  75  114  0  0  18   7  5  138  22  11    23  0  4  291
  73  134  1  1  22  10  4  140  22  11     6  0  3  292
  74   99  0  1  17   7  0  111  12  11     4  0  3  293
  72  112  1  1  16   8  0  130  30  11     6  0  3  294
  75  107  0  1  15   9  4  162   7   9    11  0  3  295
  70   99  1  0  12   7  0  139   7   9     9  0  3  296
  61   94  0  0  12   7  4  120   4   9     8  0  3  297
  71   94  0  1  16   7  4  156   9   9     3  0  3  298
  57   84  0  0  12   8  0  139   6   8     5  0  3  299
  65  111  0  0  14   8  5  137  15   9     8  0  3  300
  78   96  1  1  17  11  0  149   2  10     2  0  3  301
  60  122  0  0  13   9  0  161  26   9     5  0  3  302
  72  102  0  0  16   8  0  140  23   7     3  0  3  303
  81  102  1  0  15   8  5  128   4   8     5  0  3  304
  70   87  0  0  15   8  0  146   5  10     3  0  3  305
  62   88  0  1  12   7  6  135  10   8     3  0  3  306
  68   98  0  0  16   7  2  133  40   9     4  0  3  307
  74   97  0  0  14   8  4  136  14   8     5  0  3  308
  65  117  0  1  15   8  0  165   9   9     8  0  3  309
  74   95  0  1  18   9  0   98   2   8     7  0  3  310
  76   99  0  1  15   9  4  120   9  11     8  0  3  311
  70   78  0  0  14   7  2  149   9  11     2  0  3  312
  73  105  0  0  13   6  2  149  39   9     5  0  3  313
  71  107  0  1  18  10  4  145   9   8     3  0  3  314
  73  118  0  0  17   9  3  134   4   9     7  0  3  315
  71  108  0  0  16  12  4  141   7   9     4  0  3  316
  75  145  0  0  13   8  1  154   4   9     5  0  3  317
  70   98  0  0  11   7  4  142  19  10     5  0  3  318
  77   98  0  0  12   6  5  155   9   9     4  0  3  319
  71   87  0  0  15   8  0  156   8   8     6  0  3  320
  75  101  0  0  14   7  3  135  18   7     5  0  3  321
  74  105  0  1  16   7  4  141  10  11     3  0  3  322
  72  100  0  0  11   6  4  150   8  11     3  0  3  323
  89   92  0  1  13   6  5  136   8   9     7  0  3  324
  75   96  0  0  12   6  4  143  10  12     7  0  3  325
  71  101  0  0  14   8  4  147   3  11     5  0  3  326
  80   95  0  1  16  10  4  145   7   9     9  0  3  327
  51   96  0  0  13   8  0  118   2   6     6  0  3  328
  71   81  0  0   9   4  0  137  10   9     4  0  3  329
  72   95  0  1  10   5  0  140   8   8     7  0  3  330
  70   91  0  1  16   9  3  159   7   9    10  0  3  331
  55  103  0  0  16  10  5  167   2   8     8  0  3  332
  76  104  0  1  15   7  4  146   3   9     5  0  3  333
  68   97  0  0  17   9  4   95  11   8     5  0  3  334
  75   81  0  1  12   8  5  155  14   8     4  0  3  335
  75   91  0  0  20  10  4  118   3  11     2  0  3  337
  75   94  0  1  11   7  4  175  15   9     8  0  3  338
  72   77  0  0  13   7  0  110   4   8     5  0  3  339
  74  118  0  0  14   8  0  142   4   6     6  0  3  340
  75   91  0  0  13   7  2  121   5   8     5  0  3  341
  75   79  0  1  13   9  5  109   8   8     4  0  3  342
  71   96  0  1  12   8  4  173   5  11     8  0  3  343
  76  102  0  1  15   9  4  112  10   8     5  0  3  344
  70   83  0  0  14   7  5  117  33  13     3  0  3  345
  73  129  0  1  21  11  4  167  10   8     7  0  3  346
  70  107  0  1  13   8  5  161   7  11     8  0  3  347
  75   93  0  0  13   8  0  137  10  12     1  0  3  348
  70  127  0  0  14   7  0  162   8   9     6  0  3  349
  74   97  0  1  13   7  0  123   1   8     4  0  3  350
  72  109  0  0  16  10  0  175   8   9     7  0  3  351
  62  109  0  1  16   8  4  164  15   9     7  0  3  352
  72  111  0  0  14   8  0  153  37  11     5  0  3  353
  77   74  0  0  12   6  2  124  45  11     5  0  3  354
  52   90  0  0  12   7  4  119   5   8     5  0  3  355
  57   89  0  0  12   6  0  139  24  12     5  0  3  356
  80   90  0  1  14   8  4  143   9   8     6  0  3  357
  62   85  0  1  11   7  0  137   6   9     3  0  3  358
  72  101  0  0  13   8  0  146   8  10     5  0  3  359
  72  116  0  0  14   8  4  152  11   9     8  0  3  360
  77   91  0  1  14  10  5  145   5   9     5  0  3  361
  72  134  0  1  15   8  4  148  23   9     7  0  3  362
  73  100  0  0  18  10  5  117   8   9     7  0  3  363
  74   98  0  1  16   8  5  138  11   8    10  0  3  364
  74   82  0  1  17   4  5  109   8   8     4  0  3  365
  72  110  0  0  15   8  0  131   4   9     8  0  3  366
  76   85  0  1  14   8  5  159  25   9     9  0  3  367
  78  111  0  1  15   7  4  123   7   9     5  0  3  368
  83   88  0  1  16   8  5  100   1   7     6  0  3  369
  80   99  0  1  13   7  4  130   6   9     5  0  3  370
  76   90  0  0  15   8  3  133  52  13     4  0  3  371
  79  126  0  0  13   8  5  154   7  11     7  0  3  372
  76  116  0  1  13   8  4  169   2   9     4  0  3  373
  71  110  0  1  14   8  4  130   7  11     3  0  3  374
  61   95  0  0  12   8  4  115  37  12   256  1  4  375
  77   96  1  1  14   7  4  119  36  10     9  1  4  376
  76   82  0  0  10   6  4  103  10  13    93  1  4  377
  71  106  0  0  15   8  0  141  26  13   100  0  4  378
  77   87  0  0  11   6  1  125   5  11    22  0  4  379
  78   89  0  1  18   8  2  143  39  13   253  1  4  380
  58   92  0  0  12   8  4  137   5  11   108  1  4  381
  74  113  0  1  11   8  4  142  41  13    23  0  4  382
  75  116  0  1  18   9  2  160  26  11     5  1  4  383
  62  102  0  0  18  11  5  146  16  13   101  0  4  384
  80   92  0  0  15   9  4  131   0  13    11  0  4  385
  61   79  1  0  13   8  0  103  14  11    40  0  4  386
  76   98  0  1  17   9  5  134  19  11    38  0  4  387
  79   99  1  0  16   8  4   91  38  13   314  1  4  388
  66  116  0  0  12   8  0  149  18  12   581  0  4  389
  61   83  0  1  12   6  2  136   4  15   385  1  4  390
  79   99  0  0  17   9  4  161   4  13    61  0  4  391
  70   99  0  1  13   7  0  142  11  11    11  0  4  392
  73  105  0  1  15   7  3  156  10   9    11  0  4  393
  72   90  0  0  11   8  4  148  11  15    15  0  4  394
  81   98  0  1  13   6  0  112  38  12    87  1  4  395
  77   92  0  0  15   9  4  115   6  10     6  0  4  396
  76   76  0  0  11   6  4  148  29  13    18  0  4  397
  75  113  0  1  10   6  2  133   9  13     4  1  4  398
  72   79  0  0  14   7  0  122  24  11    72  1  4  399
  74  108  0  0  16   9  0  126  12  13    11  0  4  400
  70   85  0  0  16   8  2  164   9  13    18  0  4  401
  61   91  0  1  14   8  1  107  25  13  1522  1  4  402
  77  116  0  1  14   8  2  152   7  13   470  0  4  403
  72   86  1  0  12   7  2  140  50  15    11  0  4  405
  64  104  0  0  17   7  0  120  43  13    24  1  4  406
  78   95  0  0  15   9  4  138  55  10    32  0  4  407
  74  108  0  1  14   8  5  106   4  15    11  0  4  408
  73   83  0  1  12   7  4  112   0  11    42  0  4  409
  71  104  0  0  15   7  3  160  26  11     8  1  4  410
  75  113  0  1  17   9  4  138   9   9     7  0  3  411
  72  105  0  0  13   8  0  138   3   9     8  0  3  412
  68   89  0  1  19  10  4  138   3   9     6  0  3  413
  74   91  0  0  15   8  0  151   3   9     4  0  3  414
  72   93  0  1  16   8  4  166   4   9     2  0  3  415
  79  110  0  0  15   9  5  169   2   9     7  0  3  416
  62  104  0  1  12   8  4  160  32  11     4  0  3  417
  62  119  0  0  19  11  4  164  14   9     5  0  3  419
  72  128  0  0  15   8  4  164  15   9     6  0  3  420
  72  109  0  0  13   8  4  133  12   9     6  0  3  421
  51  112  0  0  13   9  0  158   7   8     8  0  3  422
  72  104  0  0  18  10  0  164   4   9     6  0  3  423
  81  104  0  0  15   8  0  169  16  13     8  0  3  424
  71   81  0  0  11   7  5  131  29  11   118  0  4  425
  77  103  0  0  14   7  2  143  35  11    13  0  4  426
  73  114  0  1  14   8  0  147  26  11     5  0  4  427
  56  100  0  0  17   8  4  138  30  11   506  1  4  428
  77  107  0  0  14   9  4  147   1  13    16  0  4  429
  78  104  0  0  16   9  3  127  27  11   226  0  4  430
  76   96  0  0  12   7  5  138  34  11   360  1  4  431
  68   79  0  0  18   9  2  134   9  11    12  0  4  432
  73   90  0  0  14   9  1   94  21  13    51  0  4  433
  56  135  0  0  16   9  0  147  10  10    32  0  4  434
  74  112  0  1  20  10  4  131   9  11   213  1  4  435
  69  113  0  1  13   8  0  113   1   9     1  0  3  437
  73   84  0  1  10   6  1  156   1   9     5  0  3  438
  71  105  0  0  12   8  0  136   2  10     2  0  3  439
  75   97  0  1  14   8  5  108   2   9     2  0  3  440
  69   85  0  0  15   7  5   59   2   9     3  0  3  441
  73   95  0  0  11   7  0  138   7   8     4  0  3  442
  59   81  0  0  15  10  0  160   2   9     4  0  3  443
  68   93  0  0  13   7  0  125   2   8     9  0  3  444
  78  115  0  1  14   7  3  130   2   8     1  0  3  445
  63   95  0  0  12   9  0  132   3   8     3  0  3  446
  74   85  0  0  12   9  3  141   2   9     4  0  3  447
  72  103  0  0  16   7  4  143   0   5     4  0  3  448
  78  103  0  0  11   7  5  112   0   6     6  0  3  449
  70   85  0  0  14   9  1  149   2  12     6  0  3  450
  72  101  0  0  14  10  2  164   1   9     8  0  3  451
  76  103  0  1  13   7  5  125   4   8     5  0  3  452
  66  106  0  0  12   9  5  155   4   9     5  0  3  453
  88   99  0  1  13   6  5  141  17   9     7  0  3  454
  78   88  0  1  11   6  5  109   5   9     3  0  3  455
  79  105  0  0  12   7  0  122   5  12    30  0  4  456
  77  106  0  1  15   8  2  160   1   9    22  0  4  457
  71  101  0  0  12   7  0  127   2  10    15  0  4  458
  74   91  0  1  15   8  0  126   8  13   113  0  4  459
  75  124  0  0  15  10  2  132   3  13    17  0  4  460
  77   90  0  1  10   6  3  147   2  12    82  0  4  461
  75   74  0  1  15   9  0  158   4  11    11  0  4  462
  64  110  0  0  16  10  2   93   6  11    63  1  4  463
  79   89  0  0  17  10  3  103  19  13    20  1  4  464
  60  134  2  1  16   8  5  141   9  13    12  0  4  465
  70  107  0  0  14   9  4  141   8   9     2  0  3  466
  73  111  0  1  15   8  4  170   4   9     7  0  3  467
  61  109  0  0  14   9  2  143   3  11     4  0  3  468
  79   97  1  1  16   8  4  136   3   9     6  0  3  469
  72  106  0  1  13   8  5  165  17  11     6  0  3  472
  51  100  0  0  16   9  0  146   5  13     6  0  4  476
  59   87  0  1  15   9  0  151  32  13    30  0  4  477
  73   91  0  1  16   9  2  146   4  10    32  0  4  478
  74   90  0  1  13   7  2  118   5  13    13  0  4  479
  77   93  2  1  14   9  5  118  43  11   430  1  4  480
  74   95  0  0  15   7  2  135   5  11   244  0  4  481
  60  125  0  0  11   7  0  140   9  11    13  0  4  482
  72   83  0  1  14   8  2  129  18  13    14  1  4  483
  73   71  0  0  16   8  0  134   3  11     7  1  4  486
  72  110  0  0  14   6  0  137   4  11    21  0  4  487
  80  105  2  1  14   7  5   85   6   5  1600  1  4  489
  69   71  1  1  11   8  5  137   5  13    14  1  4  490
  75  116  0  0  14   8  0  160   1  11    45  0  4  491
  71   99  1  1  14   8  3  141   1  11    17  0  4  492
  73  114  0  1  14   8  4  136   8   8     5  0  3  493
  76   99  0  1  15   9  3  160   7   9     2  0  3  494
  73  114  0  0  15   7  0  117   5   9     3  0  3  495
  76  114  0  1  30  18  4  116   6   9     5  0  3  496
  68   98  0  0  14   8  0  134   6   9     7  0  3  497
  64  100  1  0  14   7  0  140  23  11     6  0  4  498
  75  102  0  0  16   8  0  142   5  11   296  0  4  499
  60  123  0  1  14  10  4  145   6   8     5  1  4  500
  73  100  0  1  19  10  0  168   2  11    29  0  4  501
  78  108  0  0  11   6  0  158   9  13     6  0  3  502
  78  127  0  1  16  10  4  158   5   9     5  0  3  503
  77   93  0  0  17  10  3  160  11   9     8  0  3  504
  82   96  0  1  12   6  4  124  32  13    84  0  4  505
 ];


age = prostatecanc(:,1);
weight = prostatecanc(:,2);
performance = prostatecanc(:,3);
cardhist = prostatecanc(:,4);
SBP = prostatecanc(:,5);
DBP = prostatecanc(:,6);
EKGcode = prostatecanc(:,7);
hemoglobin = prostatecanc(:,8);
tumorsize = prostatecanc(:,9);
tumorgrade = prostatecanc(:,10);
acidphosph = prostatecanc(:,11);
bonemeta = prostatecanc(:,12);
class = prostatecanc(:,13) - 3;

X = [age performance cardhist tumorgrade bonemeta];
[b, dev, stats]=glmfit(X,...
    [class ones(size(class))],'binomial')

scores =   [ones(size(DBP)) X] * b;
yhat = glmval(b, X, 'logit')
plot(scores, yhat,'*')
hold on
plot(scores, class,'o')




