Docstoc

logistic regression

Document Sample
logistic regression Powered By Docstoc
					年齡        心臟病
     21         0                              心臟病
     21         0
                     1.5
     22         0




                  有無心臟病
     22         0
     22         0
                       1
     23         0
     24         0
                     0.5
     24         1
     25         0
     25         0      0
     26         0
     26         0         0      20              40   60
     26         0                                年齡
     27         0
     27         1
     28         0 平均值 的心臟病
     28         0 年齡        合計
     29         1        21      0.0
     30         0        22      0.0           1.2
     30         0        23      0.0
     30         0        24      0.5
     31         0        25      0.0           1.0
     31         0        26      0.0
     31         1        27      0.5
     32         0        28      0.0           0.8
                                       心臟病比例



     33         0        29      1.0
     33         0        30      0.0
     33         0        31      0.3
     34         0        32      0.0
                                               0.6
     34         1        33      0.0
     34         1        34      0.5
     34         0        35      0.0           0.4
     35         0        36      0.3
     35         0        37      0.5
     35         0        38      1.0           0.2
     36         0        39      0.3
     36         1        40      0.3
     36
     36
                0
                0
                         41
                         42
                                 1.0
                                 0.3
                                               0.0
                                                     21
                                                     23
                                                     24
                                                     25
                                                     26
                                                     27
                                                     28
                                                     22




     37         1        43      0.5
     37         0        44      0.3
     38         1        45      0.0
     39         0        46      0.0
39   1      47           0.3
39   0      48           0.8    摘要輸出
40   0      49           0.7
40   1      50           0.5          迴歸統計
40   0      51           0.0    R 的倍數    0.410059069
41   1      52           0.3    R 平方      0.16814844
42   0      53           0.7    調整的 R 平方  0.16138542
42   0      54           0.3    標準誤      0.454380347
42   1      55           1.0    觀察值個數            125
43   0      56           0.3
43   1      57           0.7    ANOVA
43   0      58           0.5                   自由度
43   1      59           0.5    迴歸                      1
44   0      60           0.5    殘差                    123
44   0      61           1.0    總和                    124
44   1      62           0.3
45   0      63           1.0                     係數
45   0      64           1.0    截距            -0.267950403
45   0      65           0.7    年齡             0.015241198
46   0      66           1.0
47   0      67           1.0
47   1      68           1.0
47   0      69           1.0    殘差輸出
47   0 總計              0.424
48   1 年齡        實際有無心臟病          觀察值        預測為 心臟病
48   1      21              0            1     0.052115
48   0      21              0            2     0.052115
48   1      22              0            3     0.067356
49   1      22              0            4     0.067356
49   0      22              0            5     0.067356
49   1      23              0            6     0.082597
50   0      24              0            7     0.097838
50   1      24              1            8     0.097838
51   0      25              0            9     0.113080
52   0      25              0           10     0.113080
52   1      26              0           11     0.128321
52   0      26              0           12     0.128321
53   1      26              0           13     0.128321
53   1      27              0           14     0.143562
53   0      27              1           15     0.143562
54   0      28              0           16     0.158803
54   0      28              0           17     0.158803
54   1      29              1           18     0.174044
54   0      30              0           19     0.189286
55   1   30   0   20   0.189286
56   0   30   0   21   0.189286
56   0   31   0   22   0.204527
56   1   31   0   23   0.204527
57   0   31   1   24   0.204527
57   1   32   0   25   0.219768
57   1   33   0   26   0.235009
57   0   33   0   27   0.235009
57   1   33   0   28   0.235009
57   1   34   0   29   0.250250
58   0   34   1   30   0.250250
58   0   34   1   31   0.250250
58   1   34   0   32   0.250250
58   1   35   0   33   0.265492
59   1   35   0   34   0.265492
59   0   35   0   35   0.265492
60   0   36   0   36   0.280733
60   0   36   1   37   0.280733
60   1   36   0   38   0.280733
60   1   36   0   39   0.280733
61   1   37   1   40   0.295974
61   1   37   0   41   0.295974
62   0   38   1   42   0.311215
62   0   39   0   43   0.326456
62   1   39   1   44   0.326456
63   1   39   0   45   0.326456
64   1   40   0   46   0.341698
64   1   40   1   47   0.341698
65   1   40   0   48   0.341698
65   1   41   1   49   0.356939
65   0   42   0   50   0.372180
66   1   42   0   51   0.372180
66   1   42   1   52   0.372180
67   1   43   0   53   0.387421
67   1   43   1   54   0.387421
68   1   43   0   55   0.387421
68   1   43   1   56   0.387421
69   1   44   0   57   0.402662
         44   0   58   0.402662
         44   1   59   0.402662
         45   0   60   0.417904
         45   0   61   0.417904
         45   0   62   0.417904
         46   0   63   0.433145
47   0    64   0.448386
47   1    65   0.448386
47   0    66   0.448386
47   0    67   0.448386
48   1    68   0.463627
48   1    69   0.463627
48   0    70   0.463627
48   1    71   0.463627
49   1    72   0.478868
49   0    73   0.478868
49   1    74   0.478868
50   0    75   0.494110
50   1    76   0.494110
51   0    77   0.509351
52   0    78   0.524592
52   1    79   0.524592
52   0    80   0.524592
53   1    81   0.539833
53   1    82   0.539833
53   0    83   0.539833
54   0    84   0.555074
54   0    85   0.555074
54   1    86   0.555074
54   0    87   0.555074
55   1    88   0.570316
56   0    89   0.585557
56   0    90   0.585557
56   1    91   0.585557
57   0    92   0.600798
57   1    93   0.600798
57   1    94   0.600798
57   0    95   0.600798
57   1    96   0.600798
57   1    97   0.600798
58   0    98   0.616039
58   0    99   0.616039
58   1   100   0.616039
58   1   101   0.616039
59   1   102   0.631280
59   0   103   0.631280
60   0   104   0.646521
60   0   105   0.646521
60   1   106   0.646521
60   1   107   0.646521
                                    61                       1                  108     0.661763
                                    61                       1                  109     0.661763
                                    62                       0                  110     0.677004
                                    62                       0                  111     0.677004
                                    62                       1                  112     0.677004
                                    63                       1                  113     0.692245
                                    64                       1                  114     0.707486
                                    64                       1                  115     0.707486
                                    65                       1                  116     0.722727
                                    65                       1                  117     0.722727
                                    65                       0                  118     0.722727
                                    66                       1                  119     0.737969
                                    66                       1                  120     0.737969
                                    67                       1                  121     0.753210
                                    67                       1                  122     0.753210
                                    68                       1                  123     0.768451
                                    68                       1                  124     0.768451
                                    69                       1                  125     0.783692


p(x)=exp(a+bx)/[1+exp(a+bx)]
odd=o(x)=p(x)/[1-p(x)]=exp(a+bx)
g(x)=ln[o(x)]=a+bx
Variable Value      Count
心臟病 1                53 (Event)
       0         72
       Total     125

Logistic Regression Table
                              Odds     95% CI
Predictor     Coef SE Coef    Z      P    Ratio                  Lower      Upper
Constant    -3.6066 0.8071 -4.47   0.000
age         0.07116 0.01653 4.30   0.000 1.07                1.04        1.11

Log-Likelihood = -73.985                         transforming into -2*(log-likelihood) in order to test the fitness of this logistis
Test that all slopes are zero: G = 22.418, DF = 1, P-Value = 0.000

g(x)=-3.6066+0.0712*(age)
                                                       卡方檢定

What is the critical time point that the p(x)>=0.5 ?
exp(a+bx)/[1-exp(a+bx)]>=0.5
exp(a+bx)>=0.5-0.5exp(a+bx)
exp(-3.6066+0.0712*age)>=1
-3.6066+0.0712*age>=0
age>(3.6066/0.0712)=50.6545




年齡(X) 心臟病(Y)                a+bX E(Y)=exp(a+bx)/[1-exp(a+bx)]
    21  0.0               -2.1114      0.107993729
    22  0.0               -2.0402      0.115046368        1.2
    23  0.0                -1.969      0.122496337
    24  0.5               -1.8978      0.130357674          1
    25  0.0               -1.8266      0.138643808
    26  0.0               -1.7554      0.147367394        0.8
    27  0.5               -1.6842       0.15654012
    28  0.0                -1.613       0.16617252        0.6
    29  1.0               -1.5418       0.17627376
    30  0.0               -1.4706      0.186851434        0.4
    31  0.3               -1.3994       0.19791134
    32  0.0               -1.3282      0.209457262        0.2
    33  0.0                -1.257      0.221490758
    34  0.5               -1.1858      0.234010944          0
    35  0.0               -1.1146      0.247014301            0   10   20
    36  0.3               -1.0434      0.260494495       -0.2
    37  0.5               -0.9722      0.274442213
    38  1.0                -0.901       0.28884504
    39  0.3               -0.8298      0.303687361
    40  0.3               -0.7586      0.318950299
    41  1.0               -0.6874      0.334611706
    42  0.3               -0.6162      0.350646195
    43  0.5                -0.545      0.367025223
    44  0.3               -0.4738       0.38371723
    45  0.0               -0.4026      0.400687823
    46  0.0               -0.3314      0.417900021
    47  0.3               -0.2602      0.435314544
    48  0.8                -0.189      0.452890151
    49  0.7               -0.1178      0.470584009
    50  0.5               -0.0466      0.488352108
    51  0.0                0.0246       0.50614969
    52  0.3                0.0958         0.5239317
    53  0.7                 0.167      0.541653239
    54  0.3                0.2382       0.55927002
    55  1.0                0.3094      0.576738801
    56  0.3                0.3806      0.594017807
    57  0.7                0.4518      0.611067115
    58  0.5                 0.523      0.627848999
    59  0.5                0.5942      0.644328239
60   0.5   0.6654   0.660472378
61   1.0   0.7366   0.676251923
62   0.3   0.8078      0.6916405
63   1.0    0.879   0.706614954
64   1.0   0.9502   0.721155398
65   0.7   1.0214   0.735245213
66   1.0   1.0926   0.748871002
67   1.0   1.1638   0.762022509
68   1.0    1.235   0.774692493
69   1.0   1.3062   0.786876584
     28
     29




                                   60
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40




                                   80
     41
     42
     43
     44




                             心臟病
     45
     46




年齡
     47
     48
     49
     50
     51
     52
     53


                  年齡與心臟病比例
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69




          Total
0



                                                                              1.00000

                                                                              0.50000




                                                                         殘差
                                                                              0.00000
                                                                                          0
                                                                              -0.50000

                                                                              -1.00000
        SS         MS        F     顯著值
    5.133235587 5.133236 24.862919 2.04E-06
    25.39476441 0.206461
          30.528                                                                          1.2
                                                                                              1
      標準誤        t 統計      P-值    下限 95% 上限 95%下限 95.0%      上限 95.0%
                                                                                          0.8




                                                                                   心臟病
     0.14459979 -1.85305 0.066272 -0.55418 0.018276 -0.55418 0.018276
    0.003056631 4.986273 2.043E-06 0.009191 0.021292 0.009191 0.021292                    0.6
                                                                                          0.4

       =d70-f70                               對心臟病有無,由小到大排序                               0.2
                                      機率輸出
                         =(j-0.5)/n                                                           0
      殘差 標準化殘差                  理想累積百分比  心臟病 理想Z值 實際Z值       實際累積機率
      -0.05211 -0.1152              0.40    0 -2.6521 -0.85453 19.64056
      -0.05211 -0.1152              1.20    0 -2.2571 -0.85453 19.64056
      -0.06736 -0.1488              2.00    0 -2.0537 -0.85453 19.64056
      -0.06736 -0.1488              2.80    0 -1.9110 -0.85453 19.64056
      -0.06736 -0.1488              3.60    0 -1.7991 -0.85453 19.64056
                                                                                          1.2
      -0.08260 -0.1825              4.40    0 -1.7060 -0.85453 19.64056
      -0.09784 -0.2162              5.20    0 -1.6258 -0.85453 19.64056                       1
       0.90216  1.9935              6.00    0 -1.5548 -0.85453 19.64056                   0.8
                                                                                    心臟病


      -0.11308 -0.2499              6.80    0 -1.4909 -0.85453 19.64056
      -0.11308 -0.2499              7.60    0 -1.4325 -0.85453 19.64056                   0.6
      -0.12832 -0.2836              8.40    0 -1.3787 -0.85453 19.64056                   0.4
      -0.12832 -0.2836              9.20    0 -1.3285 -0.85453 19.64056
                                                                                          0.2
      -0.12832 -0.2836             10.00    0 -1.2816 -0.85453 19.64056
      -0.14356 -0.3172             10.80    0 -1.2372 -0.85453 19.64056                       0
       0.85644  1.8925             11.60    0 -1.1952 -0.85453 19.64056                        0.00
      -0.15880 -0.3509             12.40    0 -1.1552 -0.85453 19.64056
      -0.15880 -0.3509             13.20    0 -1.1170 -0.85453 19.64056
       0.82596  1.8251             14.00    0 -1.0803 -0.85453 19.64056
      -0.18929 -0.4183             14.80    0 -1.0450 -0.85453 19.64056
-0.18929   -0.4183   15.60   0   -1.0110   -0.85453   19.64056
-0.18929   -0.4183   16.40   0   -0.9782   -0.85453   19.64056
-0.20453   -0.4519   17.20   0   -0.9463   -0.85453   19.64056
-0.20453   -0.4519   18.00   0   -0.9154   -0.85453   19.64056
 0.79547    1.7578   18.80   0   -0.8853   -0.85453   19.64056
-0.21977   -0.4856   19.60   0   -0.8560   -0.85453   19.64056
-0.23501   -0.5193   20.40   0   -0.8274   -0.85453   19.64056
-0.23501   -0.5193   21.20   0   -0.7995   -0.85453   19.64056
-0.23501   -0.5193   22.00   0   -0.7722   -0.85453   19.64056
-0.25025   -0.5530   22.80   0   -0.7454   -0.85453   19.64056
 0.74975    1.6567   23.60   0   -0.7192   -0.85453   19.64056
 0.74975    1.6567   24.40   0   -0.6935   -0.85453   19.64056
-0.25025   -0.5530   25.20   0   -0.6682   -0.85453   19.64056
-0.26549   -0.5867   26.00   0   -0.6433   -0.85453   19.64056
-0.26549   -0.5867   26.80   0   -0.6189   -0.85453   19.64056
-0.26549   -0.5867   27.60   0   -0.5948   -0.85453   19.64056
-0.28073   -0.6203   28.40   0   -0.5710   -0.85453   19.64056
 0.71927    1.5894   29.20   0   -0.5476   -0.85453   19.64056
-0.28073   -0.6203   30.00   0   -0.5244   -0.85453   19.64056
-0.28073   -0.6203   30.80   0   -0.5015   -0.85453   19.64056
 0.70403    1.5557   31.60   0   -0.4789   -0.85453   19.64056
-0.29597   -0.6540   32.40   0   -0.4565   -0.85453   19.64056
 0.68878    1.5220   33.20   0   -0.4344   -0.85453   19.64056
-0.32646   -0.7214   34.00   0   -0.4125   -0.85453   19.64056
 0.67354    1.4883   34.80   0   -0.3907   -0.85453   19.64056
-0.32646   -0.7214   35.60   0   -0.3692   -0.85453   19.64056
-0.34170   -0.7551   36.40   0   -0.3478   -0.85453   19.64056
 0.65830    1.4547   37.20   0   -0.3266   -0.85453   19.64056
-0.34170   -0.7551   38.00   0   -0.3055   -0.85453   19.64056
 0.64306    1.4210   38.80   0   -0.2845   -0.85453   19.64056
-0.37218   -0.8224   39.60   0   -0.2637   -0.85453   19.64056
-0.37218   -0.8224   40.40   0   -0.2430   -0.85453   19.64056
 0.62782    1.3873   41.20   0   -0.2224   -0.85453   19.64056
-0.38742   -0.8561   42.00   0   -0.2019   -0.85453   19.64056
 0.61258    1.3536   42.80   0   -0.1815   -0.85453   19.64056
-0.38742   -0.8561   43.60   0   -0.1611   -0.85453   19.64056
 0.61258    1.3536   44.40   0   -0.1408   -0.85453   19.64056
-0.40266   -0.8898   45.20   0   -0.1206   -0.85453   19.64056
-0.40266   -0.8898   46.00   0   -0.1004   -0.85453   19.64056
 0.59734    1.3200   46.80   0   -0.0803   -0.85453   19.64056
-0.41790   -0.9235   47.60   0   -0.0602   -0.85453   19.64056
-0.41790   -0.9235   48.40   0   -0.0401   -0.85453   19.64056
-0.41790   -0.9235   49.20   0   -0.0201   -0.85453   19.64056
-0.43314   -0.9571   50.00   0    0.0000   -0.85453   19.64056
-0.44839   -0.9908   50.80   0   0.0201   -0.85453   19.64056
 0.55161    1.2189   51.60   0   0.0401   -0.85453   19.64056
-0.44839   -0.9908   52.40   0   0.0602   -0.85453   19.64056
-0.44839   -0.9908   53.20   0   0.0803   -0.85453   19.64056
 0.53637    1.1852   54.00   0   0.1004   -0.85453   19.64056
 0.53637    1.1852   54.80   0   0.1206   -0.85453   19.64056
-0.46363   -1.0245   55.60   0   0.1408   -0.85453   19.64056
 0.53637    1.1852   56.40   0   0.1611   -0.85453   19.64056
 0.52113    1.1516   57.20   0   0.1815   -0.85453   19.64056
-0.47887   -1.0582   58.00   1   0.2019   1.160872   87.71529
 0.52113    1.1516   58.80   1   0.2224   1.160872   87.71529
-0.49411   -1.0918   59.60   1   0.2430   1.160872   87.71529
 0.50589    1.1179   60.40   1   0.2637   1.160872   87.71529
-0.50935   -1.1255   61.20   1   0.2845   1.160872   87.71529
-0.52459   -1.1592   62.00   1   0.3055   1.160872   87.71529
 0.47541    1.0505   62.80   1   0.3266   1.160872   87.71529
-0.52459   -1.1592   63.60   1   0.3478   1.160872   87.71529
 0.46017    1.0168   64.40   1   0.3692   1.160872   87.71529
 0.46017    1.0168   65.20   1   0.3907   1.160872   87.71529
-0.53983   -1.1929   66.00   1   0.4125   1.160872   87.71529
-0.55507   -1.2266   66.80   1   0.4344   1.160872   87.71529
-0.55507   -1.2266   67.60   1   0.4565   1.160872   87.71529
 0.44493    0.9832   68.40   1   0.4789   1.160872   87.71529
-0.55507   -1.2266   69.20   1   0.5015   1.160872   87.71529
 0.42968    0.9495   70.00   1   0.5244   1.160872   87.71529
-0.58556   -1.2939   70.80   1   0.5476   1.160872   87.71529
-0.58556   -1.2939   71.60   1   0.5710   1.160872   87.71529
 0.41444    0.9158   72.40   1   0.5948   1.160872   87.71529
-0.60080   -1.3276   73.20   1   0.6189   1.160872   87.71529
 0.39920    0.8821   74.00   1   0.6433   1.160872   87.71529
 0.39920    0.8821   74.80   1   0.6682   1.160872   87.71529
-0.60080   -1.3276   75.60   1   0.6935   1.160872   87.71529
 0.39920    0.8821   76.40   1   0.7192   1.160872   87.71529
 0.39920    0.8821   77.20   1   0.7454   1.160872   87.71529
-0.61604   -1.3613   78.00   1   0.7722   1.160872   87.71529
-0.61604   -1.3613   78.80   1   0.7995   1.160872   87.71529
 0.38396    0.8484   79.60   1   0.8274   1.160872   87.71529
 0.38396    0.8484   80.40   1   0.8560   1.160872   87.71529
 0.36872    0.8148   81.20   1   0.8853   1.160872   87.71529
-0.63128   -1.3950   82.00   1   0.9154   1.160872   87.71529
-0.64652   -1.4286   82.80   1   0.9463   1.160872   87.71529
-0.64652   -1.4286   83.60   1   0.9782   1.160872   87.71529
 0.35348    0.7811   84.40   1   1.0110   1.160872   87.71529
 0.35348    0.7811   85.20   1   1.0450   1.160872   87.71529
               0.33824      0.7474                     86.00            1    1.0803   1.160872   87.71529
               0.33824      0.7474                     86.80            1    1.1170   1.160872   87.71529
              -0.67700     -1.4960                     87.60            1    1.1552   1.160872   87.71529
              -0.67700     -1.4960                     88.40            1    1.1952   1.160872   87.71529
               0.32300      0.7137                     89.20            1    1.2372   1.160872   87.71529
               0.30775      0.6801                     90.00            1    1.2816   1.160872   87.71529
               0.29251      0.6464                     90.80            1    1.3285   1.160872   87.71529
               0.29251      0.6464                     91.60            1    1.3787   1.160872   87.71529
               0.27727      0.6127                     92.40            1    1.4325   1.160872   87.71529
               0.27727      0.6127                     93.20            1    1.4909   1.160872   87.71529
              -0.72273     -1.5970                     94.00            1    1.5548   1.160872   87.71529
               0.26203      0.5790                     94.80            1    1.6258   1.160872   87.71529
               0.26203      0.5790                     95.60            1    1.7060   1.160872   87.71529
               0.24679      0.5453                     96.40            1    1.7991   1.160872   87.71529
               0.24679      0.5453                     97.20            1    1.9110   1.160872   87.71529
               0.23155      0.5117                     98.00            1    2.0537   1.160872   87.71529
               0.23155      0.5117                     98.80            1    2.2571   1.160872   87.71529
               0.21631      0.4780                     99.60            1    2.6521   1.160872   87.71529

                                                                     0.424
                                                                    0.496




in order to test the fitness of this logististic regression model
30   40   50   60          70           80


                    logistics regression line   實際得病機率
         年齡        得病比例 odd
              21    0.1000 0.111111
              22    0.1000 0.111111
              23    0.1000 0.111111
              24    0.5000         1
              25    0.1000 0.111111
              26    0.1000 0.111111
              27    0.5000         1
              28    0.1000 0.111111
              29    0.9000         9
              30    0.1000 0.111111
              31    0.3333       0.5
              32    0.1000 0.111111
              33    0.1000 0.111111
              34    0.5000         1
              35    0.1000 0.111111
              36    0.2500 0.333333
              37    0.5000         1
              38    0.9000         9
              39    0.3333       0.5
              40    0.3333       0.5
              41    0.9000         9
              42    0.3333       0.5
              43    0.5000         1
              44    0.3333       0.5
              45    0.1000 0.111111
              46    0.1000 0.111111
              47    0.2500 0.333333
              48    0.7500         3
              49    0.6667         2
              50    0.5000         1
              51    0.1000 0.111111
              52    0.3333       0.5
              53    0.6667         2
              54    0.2500 0.333333
              55    0.9000         9
              56    0.3333       0.5
              57    0.6667         2
              58    0.5000         1
              59    0.5000         1
              60    0.5000         1
              61    0.9000         9
              62    0.3333       0.5
年齡 殘差圖        63    0.9000         9
            年齡 殘差圖
                                                        64   0.9000   9
                                                        65   0.6667   2
                                                        66   0.9000   9
                                                        67   0.9000   9
                                                        68   0.9000   9
                                                        69   0.9000   9
0           20          40        60     80



                       年齡

                      年齡 樣本迴歸線圖
1.2
    1
0.8
0.6
0.4
0.2
    0
        0        20          40    60     80
                                         心臟病
                        年齡
                                         預測為 心臟病

                       常態機率圖
1.2
    1
0.8
0.6
0.4
0.2
    0
     0.00             50.00    100.00          150.00
                           樣本百分比


                                  常態檢定
                                   常態檢定
                                 1.5


                                   1


                                 0.5
實際Z值




                                   0
       -3.0000 -2.0000 -1.0000     0.0000   1.0000   2.0000   3.0000

                                 -0.5


                                  -1
                                 理想Z值                                  實際Z值
log(odd)
  -2.19722   摘要輸出
  -2.19722
  -2.19722      迴歸統計
         0   R 的倍數 0.609245
  -2.19722   R 平方   0.37118
  -2.19722         0.357801
             調整的 R 平方
         0   標準誤   1.291507
  -2.19722   觀察值個數       49
 2.197225
  -2.19722   ANOVA
  -0.69315           自由度     SS      MS        F     顯著值
  -2.19722   迴歸         1 46.27526 46.27526 27.74314 3.39E-06
  -2.19722   殘差        47 78.3955 1.667989
         0   總和        48 124.6708
  -2.19722
  -1.09861             係數     標準誤 t 統計            P-值 下限 95% 上限 95%下限 95.0%
         0   截距      -3.28335 0.615387 -5.33542 2.68E-06 -4.52135 -2.04535 -4.52135
 2.197225    年齡      0.068717 0.013046 5.267175 3.39E-06 0.042471 0.094962 0.042471
  -0.69315
  -0.69315
 2.197225
  -0.69315   殘差輸出                                      機率輸出
         0
  -0.69315     預測為 log(odd)殘差 標準化殘差
             觀察值                                        百分比        log(odd)
  -2.19722      1 -1.8403 -0.35692 -0.27928             1.020408    -2.19722
  -2.19722      2 -1.77159 -0.42564 -0.33305            3.061224    -2.19722
  -1.09861      3 -1.70287 -0.49435 -0.38682            5.102041    -2.19722
 1.098612       4 -1.63416 1.634155 1.278699            7.142857    -2.19722
 0.693147       5 -1.56544 -0.63179 -0.49436            9.183673    -2.19722
         0      6 -1.49672 -0.7005 -0.54813             11.22449    -2.19722
  -2.19722      7 -1.42801 1.428005 1.11739             13.26531    -2.19722
  -0.69315      8 -1.35929 -0.83794 -0.65567            15.30612    -2.19722
 0.693147       9 -1.29057 3.487797 2.729143            17.34694    -2.19722
  -1.09861     10 -1.22186 -0.97537 -0.76321            19.38776    -2.19722
 2.197225      11 -1.15314 0.459992 0.359936            21.42857    -2.19722
  -0.69315     12 -1.08442 -1.1128 -0.87075             23.46939    -2.19722
 0.693147      13 -1.01571 -1.18152 -0.92452             25.5102    -2.19722
         0     14 -0.94699 0.946989 0.741003            27.55102    -1.09861
         0     15 -0.87827 -1.31895 -1.03206            29.59184    -1.09861
         0     16 -0.80956 -0.28906 -0.22618            31.63265    -1.09861
 2.197225      17 -0.74084 0.74084 0.579695             33.67347    -0.69315
  -0.69315     18 -0.67212 2.869348 2.245217            35.71429    -0.69315
 2.197225      19 -0.60341 -0.08974 -0.07022             37.7551    -0.69315
2.197225   20   -0.53469   -0.15846   -0.12399    39.79592   -0.69315
0.693147   21   -0.46597   2.663198   2.083908    41.83673   -0.69315
2.197225   22   -0.39726   -0.29589   -0.23153    43.87755   -0.69315
2.197225   23   -0.32854   0.328541   0.257077    45.91837   -0.69315
2.197225   24   -0.25982   -0.43332   -0.33907    47.95918   -0.69315
2.197225   25   -0.19111   -2.00612   -1.56975          50          0
           26   -0.12239   -2.07483   -1.62352    52.04082          0
           27   -0.05367   -1.04494   -0.81765    54.08163          0
           28   0.015042    1.08357   0.847875    56.12245          0
           29   0.083759   0.609388   0.476836    58.16327          0
           30   0.152475   -0.15248   -0.11931    60.20408          0
           31   0.221192   -2.41842   -1.89237     62.2449          0
           32   0.289908   -0.98306   -0.76922    64.28571          0
           33   0.358625   0.334522   0.261758    66.32653          0
           34   0.427342   -1.52595   -1.19403    68.36735   0.693147
           35   0.496058   1.701166   1.331134    70.40816   0.693147
           36   0.564775   -1.25792     -0.9843   72.44898   0.693147
           37   0.633491   0.059656    0.04668     74.4898   0.693147
           38   0.702208   -0.70221   -0.54947    76.53061   1.098612
           39   0.770924   -0.77092   -0.60324    78.57143   2.197225
           40   0.839641   -0.83964      -0.657   80.61224   2.197225
           41   0.908357   1.288867   1.008517    82.65306   2.197225
           42   0.977074   -1.67022   -1.30692    84.69388   2.197225
           43   1.045791   1.151434   0.900978    86.73469   2.197225
           44   1.114507   1.082717   0.847208    88.77551   2.197225
           45   1.183224   -0.49008   -0.38348    90.81633   2.197225
           46    1.25194   0.945284   0.739669    92.85714   2.197225
           47   1.320657   0.876568      0.6859   94.89796   2.197225
           48   1.389373   0.807851    0.63213    96.93878   2.197225
           49    1.45809   0.739135   0.578361    98.97959   2.197225
                                                      年齡 殘差圖
                                   4
                                   2
                        殘差
                                   0
                                        0        20       40    60         80
                                   -2
                                   -4
                                                          年齡



                                                       年齡 樣本迴歸線圖
                                    3

                                    2
上限 95.0%                            1
 -2.04535
                        log(odd)




                                    0
 0.094962                               0        20      40    60     80
                                   -1

                                   -2

                                   -3                                 log(odd)
                                                        年齡
                                                                      預測為 log(odd)

                                            常態機率圖

               3
               2
               1
    log(odd)




               0
                    0                       50          100     150
               -1
               -2
               -3
                                                 樣本百分比
年齡        心臟病       a+bx        p(y)      p(y)>0.5
     21         0     -2.1114    0.107994          0 預測
     21         0     -2.1114    0.107994          0              1
     22         0     -2.0402    0.115046          0              0
     22         0     -2.0402    0.115046          0         小計
     22         0     -2.0402    0.115046          0
     23         0      -1.969    0.122496          0
     24         0     -1.8978    0.130358          0 cell 期望值
     24         1     -1.8978    0.130358          0
     25         0     -1.8266    0.138644          0
     25         0     -1.8266    0.138644          0
     26         0     -1.7554    0.147367          0
     26         0     -1.7554    0.147367          0
     26         0     -1.7554    0.147367          0
     27         0     -1.6842     0.15654          0
     27         1     -1.6842     0.15654          0
     28         0      -1.613    0.166173          0
     28         0      -1.613    0.166173          0
     29         1     -1.5418    0.176274          0
     30         0     -1.4706    0.186851          0
     30         0     -1.4706    0.186851          0
     30         0     -1.4706    0.186851          0
     31         0     -1.3994    0.197911          0
     31         0     -1.3994    0.197911          0
     31         1     -1.3994    0.197911          0
     32         0     -1.3282    0.209457          0
     33         0      -1.257    0.221491          0
     33         0      -1.257    0.221491          0
     33         0      -1.257    0.221491          0
     34         0     -1.1858    0.234011          0
     34         1     -1.1858    0.234011          0
     34         1     -1.1858    0.234011          0
     34         0     -1.1858    0.234011          0
     35         0     -1.1146    0.247014          0
     35         0     -1.1146    0.247014          0
     35         0     -1.1146    0.247014          0
     36         0     -1.0434    0.260494          0
     36         1     -1.0434    0.260494          0
     36         0     -1.0434    0.260494          0
     36         0     -1.0434    0.260494          0
     37         1     -0.9722    0.274442          0
     37         0     -0.9722    0.274442          0
     38         1      -0.901    0.288845          0
     39         0     -0.8298    0.303687          0
39   1   -0.8298   0.303687    0
39   0   -0.8298   0.303687    0
40   0   -0.7586    0.31895    0
40   1   -0.7586    0.31895    0
40   0   -0.7586    0.31895    0
41   1   -0.6874   0.334612    0
42   0   -0.6162   0.350646    0
42   0   -0.6162   0.350646    0
42   1   -0.6162   0.350646    0
43   0    -0.545   0.367025    0
43   1    -0.545   0.367025    0
43   0    -0.545   0.367025    0
43   1    -0.545   0.367025    0
44   0   -0.4738   0.383717    0
44   0   -0.4738   0.383717    0
44   1   -0.4738   0.383717    0
45   0   -0.4026   0.400688    0
45   0   -0.4026   0.400688    0
45   0   -0.4026   0.400688    0
46   0   -0.3314      0.4179   0
47   0   -0.2602   0.435315    0
47   1   -0.2602   0.435315    0
47   0   -0.2602   0.435315    0
47   0   -0.2602   0.435315    0
48   1    -0.189    0.45289    0
48   1    -0.189    0.45289    0
48   0    -0.189    0.45289    0
48   1    -0.189    0.45289    0
49   1   -0.1178   0.470584    0
49   0   -0.1178   0.470584    0
49   1   -0.1178   0.470584    0
50   0   -0.0466   0.488352    0
50   1   -0.0466   0.488352    0
51   0    0.0246    0.50615    1
52   0    0.0958   0.523932    1
52   1    0.0958   0.523932    1
52   0    0.0958   0.523932    1
53   1     0.167   0.541653    1
53   1     0.167   0.541653    1
53   0     0.167   0.541653    1
54   0    0.2382    0.55927    1
54   0    0.2382    0.55927    1
54   1    0.2382    0.55927    1
54   0    0.2382    0.55927    1
55   1   0.3094   0.576739   1
56   0   0.3806   0.594018   1
56   0   0.3806   0.594018   1
56   1   0.3806   0.594018   1
57   0   0.4518   0.611067   1
57   1   0.4518   0.611067   1
57   1   0.4518   0.611067   1
57   0   0.4518   0.611067   1
57   1   0.4518   0.611067   1
57   1   0.4518   0.611067   1
58   0    0.523   0.627849   1
58   0    0.523   0.627849   1
58   1    0.523   0.627849   1
58   1    0.523   0.627849   1
59   1   0.5942   0.644328   1
59   0   0.5942   0.644328   1
60   0   0.6654   0.660472   1
60   0   0.6654   0.660472   1
60   1   0.6654   0.660472   1
60   1   0.6654   0.660472   1
61   1   0.7366   0.676252   1
61   1   0.7366   0.676252   1
62   0   0.8078    0.69164   1
62   0   0.8078    0.69164   1
62   1   0.8078    0.69164   1
63   1    0.879   0.706615   1
64   1   0.9502   0.721155   1
64   1   0.9502   0.721155   1
65   1   1.0214   0.735245   1
65   1   1.0214   0.735245   1
65   0   1.0214   0.735245   1
66   1   1.0926   0.748871   1
66   1   1.0926   0.748871   1
67   1   1.1638   0.762023   1
67   1   1.1638   0.762023   1
68   1    1.235   0.774692   1
68   1    1.235   0.774692   1
69   1   1.3062   0.786877   1
觀察
       1        0 小計
      30       19     49   成功率=   0.612245
      23       53     76          0.697368
      53       72    125


  20.776   28.224
  32.224   43.776

12.61863
卡方檢定
0.000627 11.69366

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:1/26/2013
language:Unknown
pages:43