Package install

Packages <- c("moonBook", "tidyverse", "jtools","car","readxl","dlookr","knitr")
lapply(Packages, library, character.only = TRUE)
## -- Attaching packages ------------------------------------------------------------------------------------------------------------- tidyverse 1.3.0 --
## √ ggplot2 3.3.2     √ purrr   0.3.4
## √ tibble  3.0.1     √ dplyr   0.8.5
## √ tidyr   1.1.2     √ stringr 1.4.0
## √ readr   1.3.1     √ forcats 0.5.0
## -- Conflicts ---------------------------------------------------------------------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
## Loading required package: carData
## 
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
## 
##     recode
## The following object is masked from 'package:purrr':
## 
##     some
## Loading required package: mice
## 
## Attaching package: 'mice'
## The following object is masked from 'package:moonBook':
## 
##     densityplot
## The following objects are masked from 'package:base':
## 
##     cbind, rbind
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
## 
## Attaching package: 'dlookr'
## The following object is masked from 'package:base':
## 
##     transform
## [[1]]
## [1] "moonBook"  "stats"     "graphics"  "grDevices" "utils"     "datasets" 
## [7] "methods"   "base"     
## 
## [[2]]
##  [1] "forcats"   "stringr"   "dplyr"     "purrr"     "readr"     "tidyr"    
##  [7] "tibble"    "ggplot2"   "tidyverse" "moonBook"  "stats"     "graphics" 
## [13] "grDevices" "utils"     "datasets"  "methods"   "base"     
## 
## [[3]]
##  [1] "jtools"    "forcats"   "stringr"   "dplyr"     "purrr"     "readr"    
##  [7] "tidyr"     "tibble"    "ggplot2"   "tidyverse" "moonBook"  "stats"    
## [13] "graphics"  "grDevices" "utils"     "datasets"  "methods"   "base"     
## 
## [[4]]
##  [1] "car"       "carData"   "jtools"    "forcats"   "stringr"   "dplyr"    
##  [7] "purrr"     "readr"     "tidyr"     "tibble"    "ggplot2"   "tidyverse"
## [13] "moonBook"  "stats"     "graphics"  "grDevices" "utils"     "datasets" 
## [19] "methods"   "base"     
## 
## [[5]]
##  [1] "readxl"    "car"       "carData"   "jtools"    "forcats"   "stringr"  
##  [7] "dplyr"     "purrr"     "readr"     "tidyr"     "tibble"    "ggplot2"  
## [13] "tidyverse" "moonBook"  "stats"     "graphics"  "grDevices" "utils"    
## [19] "datasets"  "methods"   "base"     
## 
## [[6]]
##  [1] "dlookr"    "mice"      "readxl"    "car"       "carData"   "jtools"   
##  [7] "forcats"   "stringr"   "dplyr"     "purrr"     "readr"     "tidyr"    
## [13] "tibble"    "ggplot2"   "tidyverse" "moonBook"  "stats"     "graphics" 
## [19] "grDevices" "utils"     "datasets"  "methods"   "base"     
## 
## [[7]]
##  [1] "knitr"     "dlookr"    "mice"      "readxl"    "car"       "carData"  
##  [7] "jtools"    "forcats"   "stringr"   "dplyr"     "purrr"     "readr"    
## [13] "tidyr"     "tibble"    "ggplot2"   "tidyverse" "moonBook"  "stats"    
## [19] "graphics"  "grDevices" "utils"     "datasets"  "methods"   "base"

Data import

d3 <- read.csv("/Users/koho0/Desktop/20201104_trim.csv") 

variable factor로 변환함수

asfactor =function(var){
  var=as.factor(var)}

data selection & mutate

d4 <- d3 %>% 
  select(no,sex,age,wt,ibw,ht,optime,antime,asa,pacu,ioh_sbp90,ioh_mbp65,iobc_50,poh_sbp90,poh_mbp65,pobc_p,group,group1,dexm_ml,dexm_u,HTN,CCB,arbacei,bb,thiazide,furo,statin,CAD,DM,clopi,pre_cr,post_cr,pre_bun,post_bun)%>%
  mutate_at(
    vars(sex,asa,ioh_sbp90,ioh_mbp65,iobc_50,poh_mbp65,poh_sbp90,pobc_p),
    funs(asfactor))%>% 
  mutate(iohypo = ifelse(ioh_sbp90 ==1|ioh_mbp65 ==1,1,0))%>%
  mutate(periophypo =ifelse(ioh_sbp90 ==1|ioh_mbp65 ==1 |poh_sbp90==1|poh_mbp65==1,1,0))%>%
  mutate(periopbc = ifelse(iobc_50 ==1|pobc_p==1,1,0))%>%
  mutate(periophbe =ifelse(periophypo ==1|periopbc ==1,1,0)) 
## Warning: funs() is soft deprecated as of dplyr 0.8.0
## Please use a list of either functions or lambdas: 
## 
##   # Simple named list: 
##   list(mean = mean, median = median)
## 
##   # Auto named with `tibble::lst()`: 
##   tibble::lst(mean, median)
## 
##   # Using lambdas
##   list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
## This warning is displayed once per session.

data 및 NA확인

glimpse(d4)
## Rows: 2,302
## Columns: 38
## $ no         <int> 920, 231, 1494, 1097, 1114, 989, 506, 1959, 998, 434, 88...
## $ sex        <fct> M, F, M, F, F, F, F, F, F, M, F, M, M, M, F, F, F, F, F,...
## $ age        <int> 25, 85, 64, 37, 47, 52, 68, 69, 36, 54, 15, 82, 34, 51, ...
## $ wt         <dbl> 60.00, 48.50, 67.30, 54.00, 59.00, 51.90, 55.31, 45.30, ...
## $ ibw        <dbl> 70.00, 44.60, 64.40, 59.00, 59.00, 43.90, 41.30, 27.20, ...
## $ ht         <dbl> 174.00, 152.60, 168.40, 167.00, 167.00, 151.90, 149.30, ...
## $ optime     <int> 54, 70, 63, 64, 64, 61, 70, 54, 140, 150, 75, 120, 56, 9...
## $ antime     <int> 71, 76, 84, 85, 74, 75, 90, 68, 153, 175, 93, 135, 86, 1...
## $ asa        <fct> 3, 3, 2, 2, 1, 2, 3, 2, 1, 2, 1, 3, 1, 2, 2, 2, 2, 2, 2,...
## $ pacu       <int> 29, 20, 27, 29, 35, 22, 30, 26, 61, 22, 51, 54, 29, 45, ...
## $ ioh_sbp90  <fct> 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ ioh_mbp65  <fct> 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0,...
## $ iobc_50    <fct> 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ poh_sbp90  <fct> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ poh_mbp65  <fct> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ pobc_p     <fct> 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,...
## $ group      <chr> "d", "m", "m", "n", "m", "d", "n", "n", "d", "n", "d", "...
## $ group1     <chr> "d", "o", "o", "o", "o", "d", "o", "o", "d", "o", "d", "...
## $ dexm_ml    <dbl> 9.00, 0.00, 0.00, 0.00, 0.00, 15.20, 0.00, 0.00, 22.12, ...
## $ dexm_u     <dbl> 0.5142857, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 1...
## $ HTN        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,...
## $ CCB        <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,...
## $ arbacei    <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,...
## $ bb         <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ thiazide   <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ furo       <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ statin     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,...
## $ CAD        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ DM         <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,...
## $ clopi      <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
## $ pre_cr     <dbl> 0.66, 4.85, 0.54, 0.17, 0.50, 0.55, 0.56, 0.68, 0.46, 0....
## $ post_cr    <dbl> 0.70, 3.02, 0.48, 0.15, 0.45, 0.53, 0.49, 0.90, 0.54, 0....
## $ pre_bun    <dbl> 3.4, 3.8, 4.8, 5.0, 5.0, 5.0, 5.0, 5.0, 5.4, 5.4, 5.5, 5...
## $ post_bun   <dbl> 3.6, 13.2, 6.3, 4.7, 5.0, 12.0, 6.7, 6.3, 6.0, 4.0, 5.7,...
## $ iohypo     <dbl> 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0,...
## $ periophypo <dbl> 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0,...
## $ periopbc   <dbl> 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0,...
## $ periophbe  <dbl> 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0,...
na.count=apply(d4,2,function(x) sum(is.na(x)))
na.count[na.count>0]
##   pre_cr  post_cr  pre_bun post_bun 
##       77       27       79       27

Comparing table

mytable(group1~.,d4,method=3,catMethod=0)
## 
##              Descriptive Statistics by 'group1'            
## ____________________________________________________________ 
##                       d                    o             p  
##                   (N=1086)              (N=1216)      
## ------------------------------------------------------------ 
##  no         1262.0 [840.0;1686.0] 969.5 [424.5;1788.5] 0.000
##  sex                                                   0.678
##    - F           506 (46.6%)          555 (45.6%)           
##    - M           580 (53.4%)          661 (54.4%)           
##  age          55.0 [37.0;66.0]      57.0 [40.5;67.0]   0.009
##  wt           63.9 [56.2;73.3]      62.5 [55.0;71.0]   0.012
##  ibw          58.0 [47.9;67.0]      57.3 [47.0;66.2]   0.226
##  ht          163.0 [155.8;171.2]  163.0 [155.0;170.3]  0.150
##  optime       61.0 [47.0;84.0]      56.0 [42.0;73.0]   0.000
##  antime       80.0 [65.0;101.0]     73.0 [59.0;91.5]   0.000
##  asa                                                   0.187
##    - 1           239 (22.0%)          253 (20.8%)           
##    - 2           696 (64.1%)          761 (62.6%)           
##    - 3           149 (13.7%)          195 (16.0%)           
##    - 4            2 ( 0.2%)            7 ( 0.6%)            
##  pacu         36.0 [27.0;49.0]      27.0 [20.0;35.0]   0.000
##  ioh_sbp90                                             0.000
##    - 0           967 (89.0%)          1169 (96.1%)          
##    - 1           119 (11.0%)           47 ( 3.9%)           
##  ioh_mbp65                                             0.000
##    - 0           904 (83.2%)          1130 (92.9%)          
##    - 1           182 (16.8%)           86 ( 7.1%)           
##  iobc_50                                               0.000
##    - 0           862 (79.4%)          1121 (92.2%)          
##    - 1           224 (20.6%)           95 ( 7.8%)           
##  poh_sbp90                                             0.000
##    - 0          1014 (93.4%)          1210 (99.5%)          
##    - 1           72 ( 6.6%)            6 ( 0.5%)            
##  poh_mbp65                                             0.000
##    - 0           968 (89.1%)          1199 (98.6%)          
##    - 1           118 (10.9%)           17 ( 1.4%)           
##  pobc_p                                                0.000
##    - 0           901 (83.0%)          1155 (95.0%)          
##    - 1           185 (17.0%)           61 ( 5.0%)           
##  group                                                 0.000
##    - d          1086 (100.0%)           0 ( 0.0%)           
##    - m            0 ( 0.0%)           710 (58.4%)           
##    - n            0 ( 0.0%)           506 (41.6%)           
##  dexm_ml      16.8 [13.5;20.1]       0.0 [ 0.0; 0.0]   0.000
##  dexm_u        1.2 [ 1.0; 1.4]       0.0 [ 0.0; 0.0]   0.000
##  HTN                                                   0.550
##    - 0           990 (91.2%)          1118 (91.9%)          
##    - 1           96 ( 8.8%)            98 ( 8.1%)           
##  CCB                                                   0.627
##    - 0          1001 (92.2%)          1113 (91.5%)          
##    - 1           85 ( 7.8%)           103 ( 8.5%)           
##  arbacei                                               0.977
##    - 0           998 (91.9%)          1116 (91.8%)          
##    - 1           88 ( 8.1%)           100 ( 8.2%)           
##  bb                                                    0.156
##    - 0          1058 (97.4%)          1196 (98.4%)          
##    - 1           28 ( 2.6%)            20 ( 1.6%)           
##  thiazide                                              0.193
##    - 0          1061 (97.7%)          1176 (96.7%)          
##    - 1           25 ( 2.3%)            40 ( 3.3%)           
##  furo                                                  0.027
##    - 0          1078 (99.3%)          1193 (98.1%)          
##    - 1            8 ( 0.7%)            23 ( 1.9%)           
##  statin                                                0.402
##    - 0          1002 (92.3%)          1134 (93.3%)          
##    - 1           84 ( 7.7%)            82 ( 6.7%)           
##  CAD                                                   0.539
##    - 0          1070 (98.5%)          1193 (98.1%)          
##    - 1           16 ( 1.5%)            23 ( 1.9%)           
##  DM                                                    0.399
##    - 0           996 (91.7%)          1102 (90.6%)          
##    - 1           90 ( 8.3%)           114 ( 9.4%)           
##  clopi                                                 1.000
##    - 0          1074 (98.9%)          1202 (98.8%)          
##    - 1           12 ( 1.1%)            14 ( 1.2%)           
##  pre_cr        0.8 [ 0.6; 0.9]       0.8 [ 0.6; 0.9]   0.064
##  post_cr       0.7 [ 0.6; 0.9]       0.8 [ 0.6; 0.9]   0.368
##  pre_bun      14.0 [11.2;17.1]      14.5 [12.0;18.0]   0.002
##  post_bun     13.0 [10.0;16.0]      13.0 [10.0;16.0]   0.604
##  iohypo                                                0.000
##    - 0           880 (81.0%)          1118 (91.9%)          
##    - 1           206 (19.0%)           98 ( 8.1%)           
##  periophypo                                            0.000
##    - 0           823 (75.8%)          1107 (91.0%)          
##    - 1           263 (24.2%)          109 ( 9.0%)           
##  periopbc                                              0.000
##    - 0           809 (74.5%)          1101 (90.5%)          
##    - 1           277 (25.5%)          115 ( 9.5%)           
##  periophbe                                             0.000
##    - 0           607 (55.9%)          998 (82.1%)           
##    - 1           479 (44.1%)          218 (17.9%)           
## ------------------------------------------------------------

dexmedetomidine만 추출

d5<- d4 %>% filter(group == "d")

Logistic regression

model <- glm(periophypo ~ ht + wt+ dexm_ml + sex + age + asa + HTN +CCB + arbacei +bb +thiazide +furo +statin +CAD +DM +clopi, data=d5, family="binomial")
summary(model)
## 
## Call:
## glm(formula = periophypo ~ ht + wt + dexm_ml + sex + age + asa + 
##     HTN + CCB + arbacei + bb + thiazide + furo + statin + CAD + 
##     DM + clopi, family = "binomial", data = d5)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.1451  -0.7745  -0.6737  -0.4847   2.0436  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   3.180985   2.024435   1.571  0.11611   
## ht           -0.022230   0.013475  -1.650  0.09899 . 
## wt           -0.010674   0.007648  -1.396  0.16283   
## dexm_ml       0.034795   0.015124   2.301  0.02141 * 
## sexM         -0.223142   0.206872  -1.079  0.28075   
## age          -0.014356   0.005402  -2.658  0.00787 **
## asa2          0.242800   0.204081   1.190  0.23416   
## asa3          0.398128   0.296867   1.341  0.17989   
## asa4        -12.046265 376.836964  -0.032  0.97450   
## HTN           0.267225   0.279878   0.955  0.33968   
## CCB           0.072235   0.306941   0.235  0.81395   
## arbacei      -0.175359   0.332770  -0.527  0.59822   
## bb            0.445197   0.427290   1.042  0.29745   
## thiazide      0.041923   0.534014   0.079  0.93743   
## furo          0.676943   0.765221   0.885  0.37635   
## statin        0.054672   0.303289   0.180  0.85695   
## CAD           0.464522   0.623625   0.745  0.45635   
## DM           -0.246079   0.303288  -0.811  0.41715   
## clopi         0.319390   0.675962   0.472  0.63657   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 1202.4  on 1085  degrees of freedom
## Residual deviance: 1172.1  on 1067  degrees of freedom
## AIC: 1210.1
## 
## Number of Fisher Scoring iterations: 12
anova(model, test="Chisq")
## Analysis of Deviance Table
## 
## Model: binomial, link: logit
## 
## Response: periophypo
## 
## Terms added sequentially (first to last)
## 
## 
##          Df Deviance Resid. Df Resid. Dev Pr(>Chi)   
## NULL                      1085     1202.4            
## ht        1   9.3679      1084     1193.0 0.002208 **
## wt        1   1.6105      1083     1191.4 0.204423   
## dexm_ml   1   5.6097      1082     1185.8 0.017861 * 
## sex       1   1.6662      1081     1184.1 0.196770   
## age       1   3.9894      1080     1180.1 0.045788 * 
## asa       3   3.4879      1077     1176.6 0.322340   
## HTN       1   0.8603      1076     1175.8 0.353668   
## CCB       1   0.0434      1075     1175.7 0.834932   
## arbacei   1   0.3837      1074     1175.3 0.535648   
## bb        1   1.3430      1073     1174.0 0.246512   
## thiazide  1   0.0010      1072     1174.0 0.974874   
## furo      1   0.6984      1071     1173.3 0.403310   
## statin    1   0.0074      1070     1173.3 0.931236   
## CAD       1   0.3254      1069     1173.0 0.568356   
## DM        1   0.6361      1068     1172.3 0.425117   
## clopi     1   0.2170      1067     1172.1 0.641353   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
reduced.model=step(model,direction="backward")
## Start:  AIC=1210.11
## periophypo ~ ht + wt + dexm_ml + sex + age + asa + HTN + CCB + 
##     arbacei + bb + thiazide + furo + statin + CAD + DM + clopi
## 
##            Df Deviance    AIC
## - asa       3   1175.2 1207.2
## - thiazide  1   1172.1 1208.1
## - statin    1   1172.1 1208.1
## - CCB       1   1172.2 1208.2
## - clopi     1   1172.3 1208.3
## - arbacei   1   1172.4 1208.4
## - CAD       1   1172.7 1208.7
## - DM        1   1172.8 1208.8
## - furo      1   1172.8 1208.8
## - HTN       1   1173.0 1209.0
## - bb        1   1173.2 1209.2
## - sex       1   1173.3 1209.3
## - wt        1   1174.1 1210.1
## <none>          1172.1 1210.1
## - ht        1   1174.8 1210.8
## - dexm_ml   1   1177.4 1213.4
## - age       1   1179.2 1215.2
## 
## Step:  AIC=1207.16
## periophypo ~ ht + wt + dexm_ml + sex + age + HTN + CCB + arbacei + 
##     bb + thiazide + furo + statin + CAD + DM + clopi
## 
##            Df Deviance    AIC
## - thiazide  1   1175.2 1205.2
## - CCB       1   1175.2 1205.2
## - statin    1   1175.2 1205.2
## - arbacei   1   1175.3 1205.3
## - clopi     1   1175.4 1205.4
## - DM        1   1175.8 1205.8
## - CAD       1   1175.8 1205.8
## - furo      1   1176.0 1206.0
## - HTN       1   1176.2 1206.2
## - bb        1   1176.3 1206.3
## - sex       1   1176.4 1206.4
## - wt        1   1177.0 1207.0
## <none>          1175.2 1207.2
## - ht        1   1177.8 1207.8
## - age       1   1180.3 1210.3
## - dexm_ml   1   1180.6 1210.6
## 
## Step:  AIC=1205.16
## periophypo ~ ht + wt + dexm_ml + sex + age + HTN + CCB + arbacei + 
##     bb + furo + statin + CAD + DM + clopi
## 
##           Df Deviance    AIC
## - CCB      1   1175.2 1203.2
## - statin   1   1175.2 1203.2
## - arbacei  1   1175.3 1203.3
## - clopi    1   1175.4 1203.4
## - DM       1   1175.8 1203.8
## - CAD      1   1175.8 1203.8
## - furo     1   1176.0 1204.0
## - HTN      1   1176.3 1204.3
## - bb       1   1176.3 1204.3
## - sex      1   1176.4 1204.4
## - wt       1   1177.0 1205.0
## <none>         1175.2 1205.2
## - ht       1   1177.8 1205.8
## - age      1   1180.4 1208.4
## - dexm_ml  1   1180.7 1208.7
## 
## Step:  AIC=1203.21
## periophypo ~ ht + wt + dexm_ml + sex + age + HTN + arbacei + 
##     bb + furo + statin + CAD + DM + clopi
## 
##           Df Deviance    AIC
## - statin   1   1175.3 1201.3
## - arbacei  1   1175.4 1201.4
## - clopi    1   1175.5 1201.5
## - CAD      1   1175.8 1201.8
## - DM       1   1175.8 1201.8
## - furo     1   1176.0 1202.0
## - sex      1   1176.4 1202.4
## - bb       1   1176.4 1202.4
## - HTN      1   1176.5 1202.5
## - wt       1   1177.0 1203.0
## <none>         1175.2 1203.2
## - ht       1   1177.8 1203.8
## - age      1   1180.4 1206.4
## - dexm_ml  1   1180.7 1206.7
## 
## Step:  AIC=1201.28
## periophypo ~ ht + wt + dexm_ml + sex + age + HTN + arbacei + 
##     bb + furo + CAD + DM + clopi
## 
##           Df Deviance    AIC
## - arbacei  1   1175.4 1199.4
## - clopi    1   1175.6 1199.6
## - CAD      1   1175.8 1199.8
## - DM       1   1175.9 1199.9
## - furo     1   1176.1 1200.1
## - sex      1   1176.5 1200.5
## - HTN      1   1176.5 1200.5
## - bb       1   1176.5 1200.5
## - wt       1   1177.1 1201.1
## <none>         1175.3 1201.3
## - ht       1   1177.9 1201.9
## - age      1   1180.4 1204.4
## - dexm_ml  1   1180.8 1204.8
## 
## Step:  AIC=1199.39
## periophypo ~ ht + wt + dexm_ml + sex + age + HTN + bb + furo + 
##     CAD + DM + clopi
## 
##           Df Deviance    AIC
## - clopi    1   1175.7 1197.7
## - CAD      1   1176.0 1198.0
## - DM       1   1176.0 1198.0
## - furo     1   1176.2 1198.2
## - HTN      1   1176.5 1198.5
## - sex      1   1176.6 1198.6
## - bb       1   1176.7 1198.7
## - wt       1   1177.3 1199.3
## <none>         1175.4 1199.4
## - ht       1   1178.0 1200.0
## - age      1   1180.7 1202.7
## - dexm_ml  1   1180.9 1202.9
## 
## Step:  AIC=1197.66
## periophypo ~ ht + wt + dexm_ml + sex + age + HTN + bb + furo + 
##     CAD + DM
## 
##           Df Deviance    AIC
## - DM       1   1176.2 1196.2
## - CAD      1   1176.2 1196.2
## - furo     1   1176.5 1196.5
## - HTN      1   1176.8 1196.8
## - sex      1   1176.9 1196.9
## - bb       1   1177.1 1197.1
## - wt       1   1177.5 1197.5
## <none>         1175.7 1197.7
## - ht       1   1178.3 1198.3
## - age      1   1180.8 1200.8
## - dexm_ml  1   1181.2 1201.2
## 
## Step:  AIC=1196.23
## periophypo ~ ht + wt + dexm_ml + sex + age + HTN + bb + furo + 
##     CAD
## 
##           Df Deviance    AIC
## - CAD      1   1176.6 1194.6
## - furo     1   1177.0 1195.0
## - HTN      1   1177.1 1195.1
## - sex      1   1177.5 1195.5
## - bb       1   1177.6 1195.6
## <none>         1176.2 1196.2
## - wt       1   1178.3 1196.3
## - ht       1   1178.8 1196.8
## - age      1   1181.9 1199.9
## - dexm_ml  1   1181.9 1199.9
## 
## Step:  AIC=1194.6
## periophypo ~ ht + wt + dexm_ml + sex + age + HTN + bb + furo
## 
##           Df Deviance    AIC
## - furo     1   1177.4 1193.4
## - HTN      1   1177.8 1193.8
## - sex      1   1177.8 1193.8
## - bb       1   1177.9 1193.9
## <none>         1176.6 1194.6
## - wt       1   1178.7 1194.7
## - ht       1   1179.1 1195.1
## - age      1   1182.0 1198.0
## - dexm_ml  1   1182.3 1198.3
## 
## Step:  AIC=1193.36
## periophypo ~ ht + wt + dexm_ml + sex + age + HTN + bb
## 
##           Df Deviance    AIC
## - HTN      1   1178.4 1192.4
## - sex      1   1178.5 1192.5
## - bb       1   1178.9 1192.9
## - wt       1   1179.3 1193.3
## <none>         1177.4 1193.4
## - ht       1   1180.0 1194.0
## - age      1   1182.6 1196.6
## - dexm_ml  1   1182.9 1196.9
## 
## Step:  AIC=1192.44
## periophypo ~ ht + wt + dexm_ml + sex + age + bb
## 
##           Df Deviance    AIC
## - sex      1   1179.6 1191.6
## - bb       1   1180.1 1192.1
## - wt       1   1180.3 1192.3
## <none>         1178.4 1192.4
## - ht       1   1181.1 1193.1
## - age      1   1182.9 1194.9
## - dexm_ml  1   1183.8 1195.8
## 
## Step:  AIC=1191.58
## periophypo ~ ht + wt + dexm_ml + age + bb
## 
##           Df Deviance    AIC
## - bb       1   1181.3 1191.3
## - wt       1   1181.4 1191.4
## <none>         1179.6 1191.6
## - dexm_ml  1   1184.5 1194.5
## - age      1   1184.6 1194.6
## - ht       1   1186.6 1196.6
## 
## Step:  AIC=1191.29
## periophypo ~ ht + wt + dexm_ml + age
## 
##           Df Deviance    AIC
## - wt       1   1182.9 1190.9
## <none>         1181.3 1191.3
## - age      1   1185.8 1193.8
## - dexm_ml  1   1186.3 1194.3
## - ht       1   1188.8 1196.8
## 
## Step:  AIC=1190.93
## periophypo ~ ht + dexm_ml + age
## 
##           Df Deviance    AIC
## <none>         1182.9 1190.9
## - dexm_ml  1   1187.5 1193.5
## - age      1   1187.9 1193.9
## - ht       1   1201.8 1207.8
summary(reduced.model)
## 
## Call:
## glm(formula = periophypo ~ ht + dexm_ml + age, family = "binomial", 
##     data = d5)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0908  -0.7741  -0.6870  -0.5295   2.0930  
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  5.192985   1.552082   3.346  0.00082 ***
## ht          -0.039093   0.009107  -4.293 1.76e-05 ***
## dexm_ml      0.031922   0.014900   2.142  0.03216 *  
## age         -0.010120   0.004548  -2.225  0.02608 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 1202.4  on 1085  degrees of freedom
## Residual deviance: 1182.9  on 1082  degrees of freedom
## AIC: 1190.9
## 
## Number of Fisher Scoring iterations: 4

OR table

ORtable=function(x,digits=2){
  suppressMessages(a<-confint(x))
  result=data.frame(exp(coef(x)),exp(a))
  result=round(result,digits)
  result=cbind(result,round(summary(x)$coefficient[,4],3))
  colnames(result)=c("OR","2.5%","97.5%","p")
  result
}

j_summ(model, scale = FALSE,
       confint = getOption("summ-confint", TRUE),
       ci.width = getOption("summ-ci.width", 0.95),
       digits = getOption("jtools-digits", default = 3),
       pvals = getOption("summ-pvals", TRUE),
       n.sd = 1,
       center = FALSE,
       transform.response = FALSE,
       exp = TRUE)
Observations 1086
Dependent variable periophypo
Type Generalized linear model
Family binomial
Link logit
χ²(18) 30.247
Pseudo-R² (Cragg-Uhler) 0.041
Pseudo-R² (McFadden) 0.025
AIC 1210.111
BIC 1304.926
exp(Est.) 2.5% 97.5% z val. p
(Intercept) 24.070 0.455 1272.583 1.571 0.116
ht 0.978 0.953 1.004 -1.650 0.099
wt 0.989 0.975 1.004 -1.396 0.163
dexm_ml 1.035 1.005 1.067 2.301 0.021
sexM 0.800 0.533 1.200 -1.079 0.281
age 0.986 0.975 0.996 -2.658 0.008
asa2 1.275 0.855 1.902 1.190 0.234
asa3 1.489 0.832 2.664 1.341 0.180
asa4 0.000 0.000 Inf -0.032 0.974
HTN 1.306 0.755 2.261 0.955 0.340
CCB 1.075 0.589 1.962 0.235 0.814
arbacei 0.839 0.437 1.611 -0.527 0.598
bb 1.561 0.676 3.606 1.042 0.297
thiazide 1.043 0.366 2.970 0.079 0.937
furo 1.968 0.439 8.818 0.885 0.376
statin 1.056 0.583 1.914 0.180 0.857
CAD 1.591 0.469 5.402 0.745 0.456
DM 0.782 0.431 1.417 -0.811 0.417
clopi 1.376 0.366 5.177 0.472 0.637
Standard errors: MLE