This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist    
##  Min.   : 4.0   Min.   :  2  
##  1st Qu.:12.0   1st Qu.: 26  
##  Median :15.0   Median : 36  
##  Mean   :15.4   Mean   : 43  
##  3rd Qu.:19.0   3rd Qu.: 56  
##  Max.   :25.0   Max.   :120

You can also embed plots, for example:

plot of chunk unnamed-chunk-2

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

data<-read.csv("C:/R_work/ECMO5.csv",header=T)
head(data)
##   Unit.number   Name Sex Age     Date Year Holiday Insertion.time
## 1      759044 여옥자   1  72 20130413 2013       0              0
## 2    16389573 남숙재   0  78 20121121 2012       1              1
## 3    15639671 이혜원   1  20 20110917 2011       0              0
## 4    16923465 최준택   0  55 20131026 2013       0              1
## 5    13412734 라길주   0  67 20100323 2010       1              1
## 6     6778542 이원희   1  75 20111214 2011       1              1
##   ECMO.duration Death Height Weight   BMI    Diagnosis Smoking CAD CVA PAD
## 1            24     0   1.57  60.85 29.97          ACS       2   0   1   1
## 2             1     0   1.55  52.30 26.51 Pump failure       0   0   1   1
## 3            19     1   1.62  54.00 24.72 Pump failure       2   1   1   1
## 4             2     0     NA     NA    NA          ACS       2   1   1   1
## 5            14     0   1.65  60.00 26.26          ACS       2   1   1   1
## 6             2     0   1.50  45.00 24.49          ACS       2   1   1   1
##   DM HBP Liver.dz Lung.dz Indication Mode CA OHCA CPR.duration
## 1  0   0        1       1          0    0  1   NA           NA
## 2  1   0        1       1          0    0  0    1           11
## 3  1   1        1       1          0    0  0    1            8
## 4  1   1        1       1          0    0  0    1           20
## 5  0   0        1       1          0    0  1   NA           NA
## 6  1   1        1       1          0    0  1   NA           NA
##   CA.ECMO.Time EKG Weaning Vent Intubation..day Hospital.day ICU.stay CRRT
## 1           NA   2       0    0              27           42       27    1
## 2           11   1       1    0               1            3        1    1
## 3           50   2       0    0              35           50       38    1
## 4           20   0       1    0               0            0        0    0
## 5           NA   2       0    0              19           20       20    1
## 6           NA   2       1    0               2            4        4    1
##   CRRT.duration CAG PCI GCS Bleeding Tamponade Pulmo AKI Liver.failure MOF
## 1            NA   0   1  10        1         1     1   1             1   0
## 2            NA   0   1   3        1         1     1   1             1   1
## 3            NA   1   1  15        0         1     1   1             1   1
## 4             1   1   1   4        0         1     1   0             1   1
## 5            NA   0   1   3        0         1     1   1             1   0
## 6            NA   0   1  15        1         0     1   1             1   1
##   Sepsis Stroke Nerve.injury Leg.ischemia   WBC  Hct PLT Sodium   K  BUN
## 1      0      1            1            1 12510 31.4 175  139.2 4.0 27.8
## 2      1      1            1            1 19470 32.2 193  142.1 4.5 34.8
## 3      1      1            0            0 10890 32.5 214  136.0 4.0  7.1
## 4      1      1            1            1  9210 35.1 125  151.6 4.0  8.8
## 5      0      1            1            1 18230 26.5 334  139.2 4.1 49.9
## 6      1      1            1            1 15670 36.2 154  150.5 3.0 40.1
##    Cr Glucose Albumin Total..bilirubin   CRP D.dimer   CK.MB Troponin PRC
## 1 1.1     372     2.6              1.0  2.19      NA  27.170    1.240 150
## 2 1.0     103     3.5              1.0 17.54      NA   3.010       NA   0
## 3 0.8     236     3.6              0.6  0.06    1.58   0.704    0.010  50
## 4 0.7     409     2.1              0.3  0.02   17.00 123.000    1.760  43
## 5 1.3     230     4.1              0.5  7.24    4.97  84.460    9.410  42
## 6 1.2     310     3.5              0.7 15.95    1.67 246.900    0.079  38
##   FFP  PC Cryo
## 1  39 202    0
## 2   0   0    0
## 3  23 146    0
## 4  18  10    8
## 5   5 170    0
## 6  11  20   10
str(data)
## 'data.frame':    78 obs. of  67 variables:
##  $ Unit.number     : Factor w/ 78 levels "`08243022","10279578",..: 63 40 29 50 11 62 27 7 48 43 ...
##  $ Name            : Factor w/ 76 levels "강신윤","강신훈",..: 34 16 53 69 17 47 28 15 74 57 ...
##  $ Sex             : int  1 0 1 0 0 1 0 1 1 0 ...
##  $ Age             : int  72 78 20 55 67 75 2 61 48 71 ...
##  $ Date            : int  20130413 20121121 20110917 20131026 20100323 20111214 20140117 20140414 20130910 20130307 ...
##  $ Year            : int  2013 2012 2011 2013 2010 2011 2014 2014 2013 2013 ...
##  $ Holiday         : int  0 1 0 0 1 1 1 1 1 1 ...
##  $ Insertion.time  : int  0 1 0 1 1 1 0 0 1 0 ...
##  $ ECMO.duration   : num  24 1 19 2 14 2 9 11 8 6 ...
##  $ Death           : int  0 0 1 0 0 0 1 1 1 0 ...
##  $ Height          : num  1.57 1.55 1.62 NA 1.65 1.5 0.91 1.52 NA 1.7 ...
##  $ Weight          : num  60.9 52.3 54 NA 60 ...
##  $ BMI             : num  30 26.5 24.7 NA 26.3 ...
##  $ Diagnosis       : Factor w/ 9 levels "ACS","ARDS","Drug Intoxication",..: 1 7 7 1 1 1 2 2 2 2 ...
##  $ Smoking         : int  2 0 2 2 2 2 2 2 2 2 ...
##  $ CAD             : int  0 0 1 1 1 1 1 1 1 1 ...
##  $ CVA             : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ PAD             : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ DM              : int  0 1 1 1 0 1 1 1 1 0 ...
##  $ HBP             : int  0 0 1 1 0 1 1 1 1 1 ...
##  $ Liver.dz        : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ Lung.dz         : int  1 1 1 1 1 1 0 0 1 1 ...
##  $ Indication      : int  0 0 0 0 0 0 1 1 1 1 ...
##  $ Mode            : int  0 0 0 0 0 0 1 1 1 1 ...
##  $ CA              : int  1 0 0 0 1 1 1 1 0 1 ...
##  $ OHCA            : int  NA 1 1 1 NA NA NA NA 1 NA ...
##  $ CPR.duration    : int  NA 11 8 20 NA NA NA NA 2 NA ...
##  $ CA.ECMO.Time    : int  NA 11 50 20 NA NA NA NA 57 NA ...
##  $ EKG             : int  2 1 2 0 2 2 2 2 2 2 ...
##  $ Weaning         : int  0 1 0 1 0 1 0 0 0 1 ...
##  $ Vent            : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ Intubation..day : Factor w/ 29 levels "","0","1","10",..: 17 3 20 2 11 12 25 7 6 26 ...
##  $ Hospital.day    : int  42 3 50 0 20 4 38 38 42 14 ...
##  $ ICU.stay        : int  27 1 38 0 20 4 8 17 19 9 ...
##  $ CRRT            : int  1 1 1 0 1 1 1 0 1 0 ...
##  $ CRRT.duration   : int  NA NA NA 1 NA NA NA 4 NA 2 ...
##  $ CAG             : int  0 0 1 1 0 0 1 1 1 1 ...
##  $ PCI             : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ GCS             : int  10 3 15 4 3 15 6 15 7 10 ...
##  $ Bleeding        : int  1 1 0 0 0 1 0 1 1 1 ...
##  $ Tamponade       : int  1 1 1 1 1 0 1 1 1 1 ...
##  $ Pulmo           : int  1 1 1 1 1 1 0 1 1 1 ...
##  $ AKI             : int  1 1 1 0 1 1 1 0 1 1 ...
##  $ Liver.failure   : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ MOF             : int  0 1 1 1 0 1 1 1 1 1 ...
##  $ Sepsis          : int  0 1 1 1 0 1 1 1 1 1 ...
##  $ Stroke          : int  1 1 1 1 1 1 0 1 1 1 ...
##  $ Nerve.injury    : int  1 1 0 1 1 1 1 1 1 1 ...
##  $ Leg.ischemia    : int  1 1 0 1 1 1 1 1 1 1 ...
##  $ WBC             : int  12510 19470 10890 9210 18230 15670 18190 7610 13350 6580 ...
##  $ Hct             : num  31.4 32.2 32.5 35.1 26.5 36.2 19.4 37.8 26.4 27 ...
##  $ PLT             : int  175 193 214 125 334 154 72 129 313 62 ...
##  $ Sodium          : num  139 142 136 152 139 ...
##  $ K               : num  4 4.5 4 4 4.1 3 4 3.5 3.6 3.6 ...
##  $ BUN             : num  27.8 34.8 7.1 8.8 49.9 40.1 27.2 8.7 20.4 15.8 ...
##  $ Cr              : num  1.1 1 0.8 0.7 1.3 1.2 0.4 0.7 0.7 0.8 ...
##  $ Glucose         : int  372 103 236 409 230 310 157 134 205 184 ...
##  $ Albumin         : num  2.6 3.5 3.6 2.1 4.1 3.5 1.8 2.8 2.2 2.5 ...
##  $ Total..bilirubin: num  1 1 0.6 0.3 0.5 0.7 0.3 1.3 2.5 1.2 ...
##  $ CRP             : num  2.19 17.54 0.06 0.02 7.24 ...
##  $ D.dimer         : num  NA NA 1.58 17 4.97 ...
##  $ CK.MB           : num  27.17 3.01 0.704 123 84.46 ...
##  $ Troponin        : num  1.24 NA 0.01 1.76 9.41 0.079 NA 0.234 0.413 0.028 ...
##  $ PRC             : int  150 0 50 43 42 38 3 12 10 22 ...
##  $ FFP             : int  39 0 23 18 5 11 0 8 0 37 ...
##  $ PC              : int  202 0 146 10 170 20 10 36 8 54 ...
##  $ Cryo            : int  0 0 0 8 0 10 0 0 0 0 ...
summary(data)
##     Unit.number      Name         Sex            Age      
##  `08243022: 1   이영순 : 2   Min.   :0.00   Min.   : 2.0  
##  10279578 : 1   이영화 : 2   1st Qu.:0.00   1st Qu.:49.2  
##  10870744 : 1   강신윤 : 1   Median :0.00   Median :63.0  
##  11071670 : 1   강신훈 : 1   Mean   :0.41   Mean   :59.6  
##  11144868 : 1   강정애 : 1   3rd Qu.:1.00   3rd Qu.:72.8  
##  11620651 : 1   김기수 : 1   Max.   :1.00   Max.   :86.0  
##  (Other)  :72   (Other):70                                
##       Date               Year         Holiday      Insertion.time 
##  Min.   :20090511   Min.   :2009   Min.   :0.000   Min.   :0.000  
##  1st Qu.:20110644   1st Qu.:2011   1st Qu.:1.000   1st Qu.:0.000  
##  Median :20121116   Median :2012   Median :1.000   Median :0.000  
##  Mean   :20120933   Mean   :2012   Mean   :0.859   Mean   :0.416  
##  3rd Qu.:20131028   3rd Qu.:2013   3rd Qu.:1.000   3rd Qu.:1.000  
##  Max.   :20140804   Max.   :2014   Max.   :1.000   Max.   :1.000  
##                                                    NA's   :1      
##  ECMO.duration      Death           Height         Weight    
##  Min.   : 0.2   Min.   :0.000   Min.   :0.91   Min.   :11.5  
##  1st Qu.: 2.0   1st Qu.:0.000   1st Qu.:1.60   1st Qu.:55.0  
##  Median : 6.0   Median :0.000   Median :1.65   Median :60.0  
##  Mean   : 7.4   Mean   :0.364   Mean   :1.64   Mean   :60.8  
##  3rd Qu.:10.8   3rd Qu.:1.000   3rd Qu.:1.70   3rd Qu.:68.0  
##  Max.   :24.0   Max.   :2.000   Max.   :1.83   Max.   :80.0  
##                 NA's   :1       NA's   :11     NA's   :9     
##       BMI              Diagnosis     Smoking          CAD       
##  Min.   :12.5   ACS         :34   Min.   :0.00   Min.   :0.000  
##  1st Qu.:24.6   ARDS        :14   1st Qu.:0.00   1st Qu.:1.000  
##  Median :27.1   PTE         : 8   Median :2.00   Median :1.000  
##  Mean   :26.8   Myocarditis : 7   Mean   :1.32   Mean   :0.795  
##  3rd Qu.:29.1   Pump failure: 7   3rd Qu.:2.00   3rd Qu.:1.000  
##  Max.   :33.5   VF, VT      : 4   Max.   :2.00   Max.   :1.000  
##  NA's   :11     (Other)     : 4                                 
##       CVA             PAD          DM             HBP      
##  Min.   :0.000   Min.   :1   Min.   :0.000   Min.   :0.00  
##  1st Qu.:1.000   1st Qu.:1   1st Qu.:1.000   1st Qu.:0.00  
##  Median :1.000   Median :1   Median :1.000   Median :1.00  
##  Mean   :0.949   Mean   :1   Mean   :0.756   Mean   :0.59  
##  3rd Qu.:1.000   3rd Qu.:1   3rd Qu.:1.000   3rd Qu.:1.00  
##  Max.   :1.000   Max.   :1   Max.   :1.000   Max.   :1.00  
##                                                            
##     Liver.dz        Lung.dz        Indication         Mode      
##  Min.   :0.000   Min.   :0.000   Min.   :0.000   Min.   :0.000  
##  1st Qu.:1.000   1st Qu.:1.000   1st Qu.:0.000   1st Qu.:0.000  
##  Median :1.000   Median :1.000   Median :0.000   Median :0.000  
##  Mean   :0.962   Mean   :0.923   Mean   :0.192   Mean   :0.192  
##  3rd Qu.:1.000   3rd Qu.:1.000   3rd Qu.:0.000   3rd Qu.:0.000  
##  Max.   :1.000   Max.   :1.000   Max.   :1.000   Max.   :1.000  
##                                                                 
##        CA             OHCA       CPR.duration    CA.ECMO.Time   
##  Min.   :0.000   Min.   :0.00   Min.   :  2.0   Min.   :   0.0  
##  1st Qu.:0.000   1st Qu.:1.00   1st Qu.: 10.8   1st Qu.:  19.5  
##  Median :0.000   Median :1.00   Median : 25.0   Median :  39.0  
##  Mean   :0.487   Mean   :0.88   Mean   : 30.6   Mean   :  92.3  
##  3rd Qu.:1.000   3rd Qu.:1.00   3rd Qu.: 40.2   3rd Qu.:  48.5  
##  Max.   :1.000   Max.   :1.00   Max.   :210.0   Max.   :1080.0  
##                  NA's   :38     NA's   :38      NA's   :38      
##       EKG          Weaning           Vent        Intubation..day
##  Min.   :0.00   Min.   :0.000   Min.   :0.0000   2      : 7     
##  1st Qu.:1.00   1st Qu.:0.000   1st Qu.:0.0000   1      : 6     
##  Median :2.00   Median :1.000   Median :0.0000   3      : 6     
##  Mean   :1.53   Mean   :0.603   Mean   :0.0385   4      : 6     
##  3rd Qu.:2.00   3rd Qu.:1.000   3rd Qu.:0.0000   6      : 6     
##  Max.   :2.00   Max.   :2.000   Max.   :1.0000   10     : 4     
##                                                  (Other):43     
##   Hospital.day     ICU.stay         CRRT       CRRT.duration  
##  Min.   : 0.0   Min.   : 0.0   Min.   :0.000   Min.   : 1.00  
##  1st Qu.: 4.0   1st Qu.: 4.0   1st Qu.:0.000   1st Qu.: 3.00  
##  Median :18.0   Median : 9.0   Median :1.000   Median : 5.00  
##  Mean   :22.5   Mean   :12.7   Mean   :0.603   Mean   : 6.39  
##  3rd Qu.:35.0   3rd Qu.:19.0   3rd Qu.:1.000   3rd Qu.: 8.00  
##  Max.   :86.0   Max.   :44.0   Max.   :1.000   Max.   :20.00  
##  NA's   :1      NA's   :1                      NA's   :47     
##       CAG           PCI             GCS           Bleeding    
##  Min.   :0.0   Min.   :0.000   Min.   : 3.00   Min.   :0.000  
##  1st Qu.:0.0   1st Qu.:0.000   1st Qu.: 4.00   1st Qu.:0.000  
##  Median :0.5   Median :1.000   Median : 7.00   Median :1.000  
##  Mean   :0.5   Mean   :0.718   Mean   : 8.26   Mean   :0.667  
##  3rd Qu.:1.0   3rd Qu.:1.000   3rd Qu.:13.00   3rd Qu.:1.000  
##  Max.   :1.0   Max.   :1.000   Max.   :15.00   Max.   :1.000  
##                                                               
##    Tamponade         Pulmo            AKI        Liver.failure  
##  Min.   :0.000   Min.   :0.000   Min.   :0.000   Min.   :0.000  
##  1st Qu.:1.000   1st Qu.:1.000   1st Qu.:0.000   1st Qu.:1.000  
##  Median :1.000   Median :1.000   Median :1.000   Median :1.000  
##  Mean   :0.949   Mean   :0.872   Mean   :0.577   Mean   :0.949  
##  3rd Qu.:1.000   3rd Qu.:1.000   3rd Qu.:1.000   3rd Qu.:1.000  
##  Max.   :1.000   Max.   :1.000   Max.   :1.000   Max.   :1.000  
##                                                                 
##       MOF            Sepsis          Stroke       Nerve.injury  
##  Min.   :0.000   Min.   :0.000   Min.   :0.000   Min.   :0.000  
##  1st Qu.:1.000   1st Qu.:1.000   1st Qu.:1.000   1st Qu.:1.000  
##  Median :1.000   Median :1.000   Median :1.000   Median :1.000  
##  Mean   :0.769   Mean   :0.859   Mean   :0.962   Mean   :0.962  
##  3rd Qu.:1.000   3rd Qu.:1.000   3rd Qu.:1.000   3rd Qu.:1.000  
##  Max.   :1.000   Max.   :1.000   Max.   :1.000   Max.   :1.000  
##                                                                 
##   Leg.ischemia        WBC             Hct            PLT       
##  Min.   :0.000   Min.   :  610   Min.   :18.1   Min.   : 17.0  
##  1st Qu.:1.000   1st Qu.: 8808   1st Qu.:30.7   1st Qu.: 97.5  
##  Median :1.000   Median :12330   Median :35.1   Median :144.5  
##  Mean   :0.949   Mean   :13493   Mean   :34.8   Mean   :162.1  
##  3rd Qu.:1.000   3rd Qu.:16602   3rd Qu.:40.0   3rd Qu.:215.5  
##  Max.   :1.000   Max.   :48290   Max.   :53.8   Max.   :414.0  
##                                                                
##      Sodium          K             BUN             Cr          Glucose   
##  Min.   :128   Min.   :2.40   Min.   : 6.3   Min.   :0.40   Min.   : 50  
##  1st Qu.:139   1st Qu.:3.62   1st Qu.:15.6   1st Qu.:0.90   1st Qu.:136  
##  Median :141   Median :4.00   Median :20.4   Median :1.20   Median :182  
##  Mean   :141   Mean   :4.20   Mean   :25.7   Mean   :1.44   Mean   :203  
##  3rd Qu.:144   3rd Qu.:4.50   3rd Qu.:32.2   3rd Qu.:1.50   3rd Qu.:247  
##  Max.   :157   Max.   :7.60   Max.   :88.9   Max.   :8.30   Max.   :488  
##                                                             NA's   :2    
##     Albumin     Total..bilirubin      CRP           D.dimer     
##  Min.   :1.40   Min.   :0.30     Min.   : 0.02   Min.   : 0.05  
##  1st Qu.:2.40   1st Qu.:0.50     1st Qu.: 0.43   1st Qu.: 1.21  
##  Median :2.95   Median :0.90     Median : 2.52   Median : 4.84  
##  Mean   :3.03   Mean   :1.24     Mean   : 7.05   Mean   : 9.84  
##  3rd Qu.:3.77   3rd Qu.:1.40     3rd Qu.:13.34   3rd Qu.:15.34  
##  Max.   :4.70   Max.   :7.10     Max.   :30.25   Max.   :45.00  
##                 NA's   :1        NA's   :1       NA's   :26     
##      CK.MB           Troponin           PRC             FFP    
##  Min.   :  0.70   Min.   : 0.010   Min.   :  0.0   Min.   : 0  
##  1st Qu.:  3.01   1st Qu.: 0.034   1st Qu.:  8.0   1st Qu.: 0  
##  Median : 16.52   Median : 0.232   Median : 18.0   Median : 7  
##  Mean   : 42.42   Mean   : 1.430   Mean   : 23.9   Mean   :11  
##  3rd Qu.: 40.55   3rd Qu.: 1.225   3rd Qu.: 31.0   3rd Qu.:17  
##  Max.   :300.00   Max.   :17.190   Max.   :150.0   Max.   :72  
##  NA's   :9        NA's   :12       NA's   :1       NA's   :1   
##        PC             Cryo     
##  Min.   :  0.0   Min.   : 0.0  
##  1st Qu.: 10.0   1st Qu.: 0.0  
##  Median : 32.0   Median : 0.0  
##  Mean   : 47.1   Mean   : 1.7  
##  3rd Qu.: 60.0   3rd Qu.: 0.0  
##  Max.   :240.0   Max.   :20.0  
##  NA's   :1       NA's   :1
data1=data[data$Death<2,-c(1,2,5)]
data1$Survive=ifelse(data1$Death==0,0,1)
hist(data1$Death,col="blue")

plot of chunk unnamed-chunk-9

library(compareGroups)
## Loading required package: Hmisc
## Loading required package: grid
## Loading required package: lattice
## Loading required package: survival
## Loading required package: splines
## Loading required package: Formula
## 
## Attaching package: 'Hmisc'
## 
## The following objects are masked from 'package:base':
## 
##     format.pval, round.POSIXt, trunc.POSIXt, units
## 
## Loading required package: xtable
## 
## Attaching package: 'xtable'
## 
## The following objects are masked from 'package:Hmisc':
## 
##     label, label<-
## 
## Loading required package: gdata
## gdata: Unable to locate valid perl interpreter
## gdata: 
## gdata: read.xls() will be unable to read Excel XLS and XLSX files
## gdata: unless the 'perl=' argument is used to specify the location
## gdata: of a valid perl intrpreter.
## gdata: 
## gdata: (To avoid display of this message in the future, please
## gdata: ensure perl is installed and available on the executable
## gdata: search path.)
## gdata: Unable to load perl libaries needed by read.xls()
## gdata: to support 'XLX' (Excel 97-2004) files.
## 
## gdata: Unable to load perl libaries needed by read.xls()
## gdata: to support 'XLSX' (Excel 2007+) files.
## 
## gdata: Run the function 'installXLSXsupport()'
## gdata: to automatically download and install the perl
## gdata: libaries needed to support Excel XLS and XLSX formats.
## 
## Attaching package: 'gdata'
## 
## The following object is masked from 'package:Hmisc':
## 
##     combine
## 
## The following object is masked from 'package:stats':
## 
##     nobs
## 
## The following object is masked from 'package:utils':
## 
##     object.size
## 
## Loading required package: SNPassoc
## Loading required package: haplo.stats
## Loading required package: mvtnorm
## Loading required package: parallel
data1$Sex=ifelse(data1$Sex==1,"Female","Male")
data1$Death=ifelse(data1$Death==1,"Survivor","Non-survivor")
data1$DM=ifelse(data1$DM==1,"No","Yes")
data1$Holiday=ifelse(data1$Holiday==1,"No","Yes")
data1$Insertion.time=ifelse(data1$Insertion.time==1,"No","Yes")
data1$Smoking=ifelse(data1$Smoking==1,"No","Yes")
data1$CAD=ifelse(data1$CAD==1,"No","Yes")
data1$CVA=ifelse(data1$CVA==1,"No","Yes")
data1$HBP=ifelse(data1$HBP==1,"No","Yes")
data1$Liver.dz=ifelse(data1$Liver.dz==1,"No","Yes")
data1$Lung.dz=ifelse(data1$Lung.dz==1,"No","Yes")
data1$Indication=ifelse(data1$Indication==1,"Respiratory","Cardiology")
data1$Mode=ifelse(data1$Mode==1,"VV","VA")
data1$CA=ifelse(data1$CA==1,"No","Yes")
data1$OHCA=ifelse(data1$OHCA==1,"IHCA","OHCA")
data1$Weaning=ifelse(data1$Weaning==1,"Fail","Success")
data1$Vent=ifelse(data1$Vent==1,"No","Yes")
data1$CRRT=ifelse(data1$CRRT==1,"No","Yes")
data1$CAG=ifelse(data1$CAG==1,"No","Yes")
data1$PCI=ifelse(data1$PCI==1,"No","Yes")
data1$Bleeding=ifelse(data1$Bleeding==1,"No","Yes")
data1$Tamponade=ifelse(data1$Tamponade==1,"No","Yes")
data1$Pulmo=ifelse(data1$Pulmo==1,"No","Yes")
data1$AKI=ifelse(data1$AKI==1,"No","Yes")
data1$Liver.failure=ifelse(data1$Liver.failure==1,"No","Yes")
data1$MOF=ifelse(data1$MOF==1,"No","Yes")
data1$Sepsis=ifelse(data1$Sepsis==1,"No","Yes")
data1$Stroke=ifelse(data1$Stroke==1,"No","Yes")
data1$Nerve.injury=ifelse(data1$Nerve.injury==1,"No","Yes")
data1$Leg.ischemia=ifelse(data1$Leg.ischemia==1,"No","Yes")
mosaicplot(~Year+Death,data=data1,color=TRUE,main="Distribution of ECMO")

plot of chunk unnamed-chunk-12

res=compareGroups(Survive~.,data=data1)
## Warning: Chi-squared approximation may be incorrect
## Warning: Chi-squared approximation may be incorrect
## Warning: Chi-squared approximation may be incorrect
## Warning: Chi-squared approximation may be incorrect
## Warning: Chi-squared approximation may be incorrect
## Warning: Chi-squared approximation may be incorrect
## Warning: Chi-squared approximation may be incorrect
## Warning: Chi-squared approximation may be incorrect
## Warning: Some levels of 'Intubation..day' are removed since no observation in that/those levels
## Warning: Chi-squared approximation may be incorrect
## Warning: Chi-squared approximation may be incorrect
## Warning: Chi-squared approximation may be incorrect
## Warning: Chi-squared approximation may be incorrect
## Warning: Variables 'PAD', 'Intubation..day' have been removed since some errors occurred
res
## 
## 
## -------- Summary of results by groups of 'Survive'---------
## 
## 
##    var              N  p.value  method            selection
## 1  Sex              74 1.000    categorical       ALL      
## 2  Age              74 0.027**  continuous normal ALL      
## 3  Year             74 0.026**  continuous normal ALL      
## 4  Holiday          74 1.000    categorical       ALL      
## 5  Insertion.time   73 0.518    categorical       ALL      
## 6  ECMO.duration    74 0.352    continuous normal ALL      
## 7  Death            74 <0.001** categorical       ALL      
## 8  Height           64 0.743    continuous normal ALL      
## 9  Weight           66 0.959    continuous normal ALL      
## 10 BMI              64 0.720    continuous normal ALL      
## 11 Diagnosis        74 0.363    categorical       ALL      
## 12 Smoking          74 0.723    categorical       ALL      
## 13 CAD              74 0.529    categorical       ALL      
## 14 CVA              74 1.000    categorical       ALL      
## 15 DM               74 0.211    categorical       ALL      
## 16 HBP              74 0.161    categorical       ALL      
## 17 Liver.dz         74 0.550    categorical       ALL      
## 18 Lung.dz          74 1.000    categorical       ALL      
## 19 Indication       74 0.746    categorical       ALL      
## 20 Mode             74 0.746    categorical       ALL      
## 21 CA               74 0.115    categorical       ALL      
## 22 OHCA             39 1.000    categorical       ALL      
## 23 CPR.duration     39 0.055*   continuous normal ALL      
## 24 CA.ECMO.Time     39 0.076*   continuous normal ALL      
## 25 EKG              74 0.002**  continuous normal ALL      
## 26 Weaning          74 <0.001** categorical       ALL      
## 27 Vent             74 0.024**  categorical       ALL      
## 28 Hospital.day     74 <0.001** continuous normal ALL      
## 29 ICU.stay         74 0.001**  continuous normal ALL      
## 30 CRRT             74 0.269    categorical       ALL      
## 31 CRRT.duration    29 0.175    continuous normal ALL      
## 32 CAG              74 0.203    categorical       ALL      
## 33 PCI              74 0.675    categorical       ALL      
## 34 GCS              74 0.001**  continuous normal ALL      
## 35 Bleeding         74 0.374    categorical       ALL      
## 36 Tamponade        74 1.000    categorical       ALL      
## 37 Pulmo            74 0.422    categorical       ALL      
## 38 AKI              74 0.376    categorical       ALL      
## 39 Liver.failure    74 0.311    categorical       ALL      
## 40 MOF              74 0.002**  categorical       ALL      
## 41 Sepsis           74 1.000    categorical       ALL      
## 42 Stroke           74 0.297    categorical       ALL      
## 43 Nerve.injury     74 0.024**  categorical       ALL      
## 44 Leg.ischemia     74 0.577    categorical       ALL      
## 45 WBC              74 0.643    continuous normal ALL      
## 46 Hct              74 0.537    continuous normal ALL      
## 47 PLT              74 0.493    continuous normal ALL      
## 48 Sodium           74 0.503    continuous normal ALL      
## 49 K                74 0.018**  continuous normal ALL      
## 50 BUN              74 0.013**  continuous normal ALL      
## 51 Cr               74 0.004**  continuous normal ALL      
## 52 Glucose          72 0.532    continuous normal ALL      
## 53 Albumin          74 0.634    continuous normal ALL      
## 54 Total..bilirubin 73 0.521    continuous normal ALL      
## 55 CRP              73 0.198    continuous normal ALL      
## 56 D.dimer          48 0.859    continuous normal ALL      
## 57 CK.MB            65 0.797    continuous normal ALL      
## 58 Troponin         63 0.494    continuous normal ALL      
## 59 PRC              74 0.187    continuous normal ALL      
## 60 FFP              74 0.338    continuous normal ALL      
## 61 PC               74 0.074*   continuous normal ALL      
## 62 Cryo             74 0.753    continuous normal ALL      
## -----
## Signif. codes:  0 '**' 0.05 '*' 0.1 ' ' 1
createTable(res)
## 
## --------Summary descriptives table by 'Survive'---------
## 
## _________________________________________________________ 
##                            0            1       p.overall 
##                           N=52         N=22               
## <U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF> 
## Sex:                                              1.000   
##     Female             20 (38.5%)   9 (40.9%)             
##     Male               32 (61.5%)   13 (59.1%)            
## Age                   63.8 (13.6)  52.9 (20.0)    0.027   
## Year                  2012 (1.40)  2013 (1.44)    0.026   
## Holiday:                                          1.000   
##     No                 44 (84.6%)   19 (86.4%)            
##     Yes                8 (15.4%)    3 (13.6%)             
## Insertion.time:                                   0.518   
##     No                 22 (43.1%)   7 (31.8%)             
##     Yes                29 (56.9%)   15 (68.2%)            
## ECMO.duration         6.75 (6.51)  8.01 (4.65)    0.352   
## Death:                                           <0.001   
##     Non-survivor       52 (100%)    0 (0.00%)             
##     Survivor           0 (0.00%)    22 (100%)             
## Height                1.64 (0.08)  1.63 (0.19)    0.743   
## Weight                60.6 (8.69)  60.8 (14.6)    0.959   
## BMI                   26.7 (3.50)  26.4 (4.07)    0.720   
## Diagnosis:                                        0.363   
##     ACS                27 (51.9%)   6 (27.3%)             
##     ARDS               8 (15.4%)    5 (22.7%)             
##     Drug Intoxication  1 (1.92%)    0 (0.00%)             
##     LA myxoma          1 (1.92%)    0 (0.00%)             
##     Myocarditis        2 (3.85%)    3 (13.6%)             
##     PTE                4 (7.69%)    4 (18.2%)             
##     Pump failure       5 (9.62%)    2 (9.09%)             
##     Trauma             1 (1.92%)    1 (4.55%)             
##     VF, VT             3 (5.77%)    1 (4.55%)             
## Smoking:                                          0.723   
##     No                 7 (13.5%)    4 (18.2%)             
##     Yes                45 (86.5%)   18 (81.8%)            
## CAD:                                              0.529   
##     No                 40 (76.9%)   19 (86.4%)            
##     Yes                12 (23.1%)   3 (13.6%)             
## CVA:                                              1.000   
##     No                 49 (94.2%)   21 (95.5%)            
##     Yes                3 (5.77%)    1 (4.55%)             
## DM:                                               0.211   
##     No                 36 (69.2%)   19 (86.4%)            
##     Yes                16 (30.8%)   3 (13.6%)             
## HBP:                                              0.161   
##     No                 27 (51.9%)   16 (72.7%)            
##     Yes                25 (48.1%)   6 (27.3%)             
## Liver.dz:                                         0.550   
##     No                 49 (94.2%)   22 (100%)             
##     Yes                3 (5.77%)    0 (0.00%)             
## Lung.dz:                                          1.000   
##     No                 48 (92.3%)   20 (90.9%)            
##     Yes                4 (7.69%)    2 (9.09%)             
## Indication:                                       0.746   
##     Cardiology         43 (82.7%)   17 (77.3%)            
##     Respiratory        9 (17.3%)    5 (22.7%)             
## Mode:                                             0.746   
##     VA                 43 (82.7%)   17 (77.3%)            
##     VV                 9 (17.3%)    5 (22.7%)             
## CA:                                               0.115   
##     No                 21 (40.4%)   14 (63.6%)            
##     Yes                31 (59.6%)   8 (36.4%)             
## OHCA:                                             1.000   
##     IHCA               27 (87.1%)   7 (87.5%)             
##     OHCA               4 (12.9%)    1 (12.5%)             
## CPR.duration          33.8 (36.7)  16.9 (15.0)    0.055   
## CA.ECMO.Time           109 (221)   35.2 (16.3)    0.076   
## EKG                   1.35 (0.90)  1.86 (0.47)    0.002   
## Weaning:                                         <0.001   
##     Fail               44 (84.6%)   0 (0.00%)             
##     Success            8 (15.4%)    22 (100%)             
## Vent:                                             0.024   
##     No                 0 (0.00%)    3 (13.6%)             
##     Yes                52 (100%)    19 (86.4%)            
## Hospital.day          14.7 (15.6)  40.9 (18.4)   <0.001   
## ICU.stay              9.75 (9.43)  18.4 (10.0)    0.001   
## CRRT:                                             0.269   
##     No                 29 (55.8%)   16 (72.7%)            
##     Yes                23 (44.2%)   6 (27.3%)             
## CRRT.duration         5.78 (4.65)  9.17 (5.00)    0.175   
## CAG:                                              0.203   
##     No                 23 (44.2%)   14 (63.6%)            
##     Yes                29 (55.8%)   8 (36.4%)             
## PCI:                                              0.675   
##     No                 36 (69.2%)   17 (77.3%)            
##     Yes                16 (30.8%)   5 (22.7%)             
## GCS                   6.81 (4.24)  10.7 (4.51)    0.001   
## Bleeding:                                         0.374   
##     No                 33 (63.5%)   17 (77.3%)            
##     Yes                19 (36.5%)   5 (22.7%)             
## Tamponade:                                        1.000   
##     No                 49 (94.2%)   21 (95.5%)            
##     Yes                3 (5.77%)    1 (4.55%)             
## Pulmo:                                            0.422   
##     No                 45 (86.5%)   21 (95.5%)            
##     Yes                7 (13.5%)    1 (4.55%)             
## AKI:                                              0.376   
##     No                 28 (53.8%)   15 (68.2%)            
##     Yes                24 (46.2%)   7 (31.8%)             
## Liver.failure:                                    0.311   
##     No                 48 (92.3%)   22 (100%)             
##     Yes                4 (7.69%)    0 (0.00%)             
## MOF:                                              0.002   
##     No                 36 (69.2%)   22 (100%)             
##     Yes                16 (30.8%)   0 (0.00%)             
## Sepsis:                                           1.000   
##     No                 46 (88.5%)   20 (90.9%)            
##     Yes                6 (11.5%)    2 (9.09%)             
## Stroke:                                           0.297   
##     No                 52 (100%)    21 (95.5%)            
##     Yes                0 (0.00%)    1 (4.55%)             
## Nerve.injury:                                     0.024   
##     No                 52 (100%)    19 (86.4%)            
##     Yes                0 (0.00%)    3 (13.6%)             
## Leg.ischemia:                                     0.577   
##     No                 50 (96.2%)   20 (90.9%)            
##     Yes                2 (3.85%)    2 (9.09%)             
## WBC                   13751 (8254) 12977 (5665)   0.643   
## Hct                   34.4 (7.31)  35.7 (8.00)    0.537   
## PLT                    167 (100)    152 (78.5)    0.493   
## Sodium                 142 (5.23)   141 (5.82)    0.503   
## K                     4.36 (1.07)  3.94 (0.45)    0.018   
## BUN                   28.7 (17.7)  20.2 (10.5)    0.013   
## Cr                    1.62 (1.23)  1.06 (0.40)    0.004   
## Glucose                207 (108)    195 (59.4)    0.532   
## Albumin               2.99 (0.88)  3.09 (0.79)    0.634   
## Total..bilirubin      1.19 (1.36)  1.41 (1.29)    0.521   
## CRP                   6.12 (7.73)  9.46 (10.7)    0.198   
## D.dimer               9.86 (12.2)  9.21 (11.7)    0.859   
## CK.MB                 36.2 (47.2)  31.5 (72.9)    0.797   
## Troponin              1.53 (3.48)  1.03 (2.17)    0.494   
## PRC                   26.5 (27.6)  19.2 (18.3)    0.187   
## FFP                   11.9 (14.2)  8.91 (11.3)    0.338   
## PC                    53.6 (62.1)  33.4 (33.3)    0.074   
## Cryo                  1.87 (4.83)  1.55 (3.54)    0.753   
## <U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF><U+00AF>

교수님 이 항목에서 EKG 를 0:asystole, 1: PEA, 2: 그외 EKG 로 구분 하려고 하는데요. data1\(EKG.=ifelse(data1\)EKG.==1,“PEA”,0,“Asystole”,2,“Etc) 이렇게 넣으니 안되더라구요 ㅠㅠ 어떻게 넣어야 구분이 될까요??

out=lm(Survive~Age+Diagnosis+OHCA+CA.ECMO.Time+EKG+CRRT+GCS+Cr+K,data=data1)
anova(out)
## Analysis of Variance Table
## 
## Response: Survive
##              Df Sum Sq Mean Sq F value Pr(>F)  
## Age           1  0.557   0.557    4.23  0.052 .
## Diagnosis     8  1.832   0.229    1.74  0.145  
## OHCA          1  0.022   0.022    0.17  0.686  
## CA.ECMO.Time  1  0.021   0.021    0.16  0.696  
## EKG           1  0.473   0.473    3.59  0.071 .
## CRRT          1  0.084   0.084    0.64  0.433  
## GCS           1  0.388   0.388    2.95  0.100  
## Cr            1  0.071   0.071    0.54  0.469  
## K             1  0.017   0.017    0.13  0.725  
## Residuals    22  2.895   0.132                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

P값이 높은 OHCA, CA>ECMO.Time, K 를 빼고 돌리면

out2=lm(Survive~Age+Diagnosis+EKG+CRRT+GCS+Cr,data=data1)
anova(out2)
## Analysis of Variance Table
## 
## Response: Survive
##           Df Sum Sq Mean Sq F value Pr(>F)   
## Age        1   1.44   1.438    8.72 0.0045 **
## Diagnosis  8   1.03   0.128    0.78 0.6239   
## EKG        1   0.72   0.718    4.35 0.0412 * 
## CRRT       1   0.50   0.497    3.01 0.0877 . 
## GCS        1   1.36   1.363    8.27 0.0056 **
## Cr         1   0.52   0.524    3.18 0.0797 . 
## Residuals 60   9.89   0.165                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
confint(out2)
##                                2.5 %    97.5 %
## (Intercept)                -0.032445  1.071987
## Age                        -0.014697 -0.000957
## DiagnosisARDS              -0.257391  0.327813
## DiagnosisDrug Intoxication -1.060384  0.650712
## DiagnosisLA myxoma         -1.184656  0.588292
## DiagnosisMyocarditis       -0.381197  0.500980
## DiagnosisPTE               -0.111936  0.544462
## DiagnosisPump failure      -0.528952  0.185235
## DiagnosisTrauma            -0.609700  0.675932
## DiagnosisVF, VT            -0.447738  0.462866
## EKG                        -0.027655  0.229246
## CRRTYes                    -0.305657  0.137711
## GCS                         0.007977  0.053397
## Cr                         -0.179223  0.010322

Diagnosis 를 빼고 돌리면,

out3=lm(Survive~Age+EKG+CRRT+GCS+Cr,data=data1)
anova(out3)
## Analysis of Variance Table
## 
## Response: Survive
##           Df Sum Sq Mean Sq F value Pr(>F)   
## Age        1   1.44   1.438    9.22 0.0034 **
## EKG        1   0.92   0.922    5.91 0.0177 * 
## CRRT       1   0.73   0.727    4.66 0.0344 * 
## GCS        1   1.27   1.266    8.12 0.0058 **
## Cr         1   0.50   0.497    3.19 0.0787 . 
## Residuals 68  10.61   0.156                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
confint(out3)
##                 2.5 %    97.5 %
## (Intercept)  0.060069  0.989091
## Age         -0.013379 -0.001884
## EKG         -0.002738  0.229068
## CRRTYes     -0.308787  0.089654
## GCS          0.007326  0.048989
## Cr          -0.168969  0.009407
out4=lm(Survive~Age+EKG+CRRT+GCS,data=data1)
anova(out4)
## Analysis of Variance Table
## 
## Response: Survive
##           Df Sum Sq Mean Sq F value Pr(>F)   
## Age        1   1.44   1.438    8.93 0.0039 **
## EKG        1   0.92   0.922    5.73 0.0194 * 
## CRRT       1   0.73   0.727    4.52 0.0372 * 
## GCS        1   1.27   1.266    7.87 0.0065 **
## Residuals 69  11.11   0.161                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

여기에서 P 값이 0.05 이하인 변수들이 생존에 영향을 미칠수 있다고 볼 수 보는 것이죠? 교수님

summary(out4)
## 
## Call:
## lm(formula = Survive ~ Age + EKG + CRRT + GCS, data = data1)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.6707 -0.3337 -0.0469  0.2514  0.7594 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  0.44211    0.23174    1.91   0.0606 . 
## Age         -0.00792    0.00292   -2.71   0.0084 **
## EKG          0.10581    0.05885    1.80   0.0765 . 
## CRRTYes     -0.15300    0.09835   -1.56   0.1243   
## GCS          0.02965    0.01057    2.80   0.0065 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.401 on 69 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.282,  Adjusted R-squared:  0.24 
## F-statistic: 6.76 on 4 and 69 DF,  p-value: 0.000119

Summary 를 돌리면 EKG 와 CRRT 는 P 값이 0.05보다 커져 버리는데 그럼 생존에 영향을 미치는 인자로 보기 어려운 것인가요?

R2 = 28.2% 로 모형이 종속변수 Survive를 28.2%설명할 수 있다.

out=glm(Survive~Age+EKG+CRRT+GCS+Cr,family=binomial,data=data1)
summary(out)
## 
## Call:
## glm(formula = Survive ~ Age + EKG + CRRT + GCS + Cr, family = binomial, 
##     data = data1)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.733  -0.667  -0.246   0.277   2.224  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   1.3538     2.0020    0.68   0.4989   
## Age          -0.0647     0.0264   -2.45   0.0143 * 
## EKG           1.1460     0.5513    2.08   0.0376 * 
## CRRTYes      -0.5450     0.7677   -0.71   0.4778   
## GCS           0.2370     0.0842    2.81   0.0049 **
## Cr           -1.6979     0.7198   -2.36   0.0183 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 90.066  on 73  degrees of freedom
## Residual deviance: 57.047  on 68  degrees of freedom
##   (1 observation deleted due to missingness)
## AIC: 69.05
## 
## Number of Fisher Scoring iterations: 6
exp(coef(out))
## (Intercept)         Age         EKG     CRRTYes         GCS          Cr 
##      3.8721      0.9374      3.1457      0.5799      1.2674      0.1831
confint(out)
## Waiting for profiling to be done...
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                2.5 %   97.5 %
## (Intercept) -2.60432  5.44163
## Age         -0.12329 -0.01866
## EKG          0.19637  2.46618
## CRRTYes     -2.12547  0.94278
## GCS          0.08441  0.42072
## Cr          -3.36234 -0.49399
exp(confint(out))
## Waiting for profiling to be done...
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##               2.5 %   97.5 %
## (Intercept) 0.07395 230.8188
## Age         0.88400   0.9815
## EKG         1.21698  11.7773
## CRRTYes     0.11938   2.5671
## GCS         1.08808   1.5231
## Cr          0.03465   0.6102

여기에서 CRRT 를 제외한 변수의 P값이 유의하므로 모형에 넣고 돌리면

out2=glm(Survive~Age+EKG+GCS+Cr,family=binomial,data=data1)
summary(out2)
## 
## Call:
## glm(formula = Survive ~ Age + EKG + GCS + Cr, family = binomial, 
##     data = data1)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.700  -0.695  -0.259   0.302   2.240  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   1.0416     1.9012    0.55   0.5838   
## Age          -0.0601     0.0245   -2.45   0.0143 * 
## EKG           1.1072     0.5404    2.05   0.0405 * 
## GCS           0.2425     0.0838    2.89   0.0038 **
## Cr           -1.8117     0.7105   -2.55   0.0108 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 90.066  on 73  degrees of freedom
## Residual deviance: 57.560  on 69  degrees of freedom
##   (1 observation deleted due to missingness)
## AIC: 67.56
## 
## Number of Fisher Scoring iterations: 6
exp(coef(out2))
## (Intercept)         Age         EKG         GCS          Cr 
##      2.8337      0.9417      3.0260      1.2744      0.1634
confint(out2)
## Waiting for profiling to be done...
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                2.5 %   97.5 %
## (Intercept) -2.77808  4.86875
## Age         -0.11371 -0.01661
## EKG          0.17504  2.40658
## GCS          0.09109  0.42566
## Cr          -3.46329 -0.63211
exp(confint(out2))
## Waiting for profiling to be done...
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##               2.5 %   97.5 %
## (Intercept) 0.06216 130.1580
## Age         0.89251   0.9835
## EKG         1.19130  11.0959
## GCS         1.09537   1.5306
## Cr          0.03133   0.5315