This is a revised version due to minor errors and we also included a PT-Br version of PONV x smoking figure.
Guimaraes, Gabriel (2018), “PONV risk factors in onchological surgery”, Mendeley Data, v1 http://dx.doi.org/10.17632/gsnj8vmgm2.1
## Type 'citation("pROC")' for a citation.
##
## Attaching package: 'pROC'
## The following objects are masked from 'package:stats':
##
## cov, smooth, var
x=c("a: Still Smokes","b: 1 month ago","c: 1-6 \nmonths ago","d: more than\n 6 months ago","e: Never smoked")
p1=sum(ponv$when.stopped.smoking=="a.smokes",na.rm=TRUE)/(sum(ponv$when.stopped.smoking=="a.smokes",na.rm=TRUE)+sum(nponv$when.stopped.smoking=="a.smokes",na.rm=TRUE))
p2=sum(ponv$when.stopped.smoking=="b.1.month.ago",na.rm=TRUE)/(sum(ponv$when.stopped.smoking=="b.1.month.ago",na.rm=TRUE)+sum(nponv$when.stopped.smoking=="b.1.month.ago",na.rm=TRUE))
p3=sum(ponv$when.stopped.smoking=="c.1-6.months.ago",na.rm=TRUE)/(sum(ponv$when.stopped.smoking=="c.1-6.months.ago",na.rm=TRUE)+sum(nponv$when.stopped.smoking=="c.1-6.months.ago",na.rm=TRUE))
p4=sum(ponv$when.stopped.smoking=="d.>6months.ago",na.rm=TRUE)/(sum(ponv$when.stopped.smoking=="d.>6months.ago",na.rm=TRUE)+sum(nponv$when.stopped.smoking=="d.>6months.ago",na.rm=TRUE))
p5=sum(ponv$when.stopped.smoking=="e.never.smoked",na.rm=TRUE)/(sum(ponv$when.stopped.smoking=="e.never.smoked",na.rm=TRUE)+sum(nponv$when.stopped.smoking=="e.never.smoked",na.rm=TRUE))
y=c(p1,p2,p3,p4,p5)
over=floor(y*10000)/10000
dados=data.frame(Stopped.Smoking=x,probability=y)
ggplot(dados,aes(Stopped.Smoking,probability)) + geom_bar(stat="identity",aes(fill=Stopped.Smoking),position = 'dodge')+theme_bw()+scale_fill_grey(start = 0, end = .9)+guides(fill=FALSE)+labs(x = "Stopped smoking", y = "Probability of PONV") + geom_text(aes(label=over), position=position_dodge(width=0.9), vjust=-0.25)
x=c("a: Fuma","b: Parou até 1 mês","c: Parou 1-6 meses","d: Parou mais\n que 6 meses","e: Nunca fumou")
p1=sum(ponv$when.stopped.smoking=="a.smokes",na.rm=TRUE)/(sum(ponv$when.stopped.smoking=="a.smokes",na.rm=TRUE)+sum(nponv$when.stopped.smoking=="a.smokes",na.rm=TRUE))
p2=sum(ponv$when.stopped.smoking=="b.1.month.ago",na.rm=TRUE)/(sum(ponv$when.stopped.smoking=="b.1.month.ago",na.rm=TRUE)+sum(nponv$when.stopped.smoking=="b.1.month.ago",na.rm=TRUE))
p3=sum(ponv$when.stopped.smoking=="c.1-6.months.ago",na.rm=TRUE)/(sum(ponv$when.stopped.smoking=="c.1-6.months.ago",na.rm=TRUE)+sum(nponv$when.stopped.smoking=="c.1-6.months.ago",na.rm=TRUE))
p4=sum(ponv$when.stopped.smoking=="d.>6months.ago",na.rm=TRUE)/(sum(ponv$when.stopped.smoking=="d.>6months.ago",na.rm=TRUE)+sum(nponv$when.stopped.smoking=="d.>6months.ago",na.rm=TRUE))
p5=sum(ponv$when.stopped.smoking=="e.never.smoked",na.rm=TRUE)/(sum(ponv$when.stopped.smoking=="e.never.smoked",na.rm=TRUE)+sum(nponv$when.stopped.smoking=="e.never.smoked",na.rm=TRUE))
y=c(p1,p2,p3,p4,p5)
over=floor(y*10000)/10000
dados=data.frame(Stopped.Smoking=x,probability=y)
ggplot(dados,aes(Stopped.Smoking,probability)) + geom_bar(stat="identity",aes(fill=Stopped.Smoking),position = 'dodge')+theme_bw()+scale_fill_grey(start = 0, end = .9)+guides(fill=FALSE)+labs(x = "Parou de fumar?", y = "Probabilidade de NVPO") + geom_text(aes(label=over), position=position_dodge(width=0.9), vjust=-0.25)
#number of tests
nt=0
p_values=1
tests=""
# SEX
table(leiaf$sex,leiaf$ponv)
##
## FALSE TRUE
## Female 707 404
## Male 559 159
chisq.test(leiaf$sex,leiaf$ponv)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$sex and leiaf$ponv
## X-squared = 40.72, df = 1, p-value = 1.757e-10
nt=nt+1
p_values[nt]=unname(chisq.test(leiaf$sex,leiaf$ponv)[3])
tests[nt]="SEX"
# APFEL
table(leiaf$Apfel,leiaf$ponv)
##
## FALSE TRUE
## 0 52 8
## 1 219 57
## 2 534 168
## 3 379 217
## 4 82 113
wilcox.test(leiaf$Apfel~leiaf$ponv)
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$Apfel by leiaf$ponv
## W = 258730, p-value < 2.2e-16
## alternative hypothesis: true location shift is not equal to 0
nt=nt+1
p_values[nt]=unname(wilcox.test(leiaf$Apfel~leiaf$ponv)[3])
tests[nt]="APFEL"
# AGE
comparenp(leiaf$age,leiaf$ponv,"Age in years")
## [1] "Mean Age in years in no PONV group: "
## [1] 58.56793
## [1] "Standard deviation in no PONV group"
## [1] 13.31018
## [1] "Mean Age in years in PONV group: "
## [1] 55.56128
## [1] "Standard deviation in PONV group"
## [1] 14.86706
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.0001595741
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$age ~leiaf$ponv)
t
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$age by leiaf$ponv
## W = 395730, p-value = 0.0001596
## alternative hypothesis: true location shift is not equal to 0
nt=nt+1
p_values[nt]=unname(t[3])
tests[nt]="AGE"
# PREVIOUS PONV
table(leiaf$previous.ponv,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1053 367
## TRUE 213 196
chisq.test(leiaf$previous.ponv,leiaf$ponv)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$previous.ponv and leiaf$ponv
## X-squared = 71.603, df = 1, p-value < 2.2e-16
nt=nt+1
p_values[nt]=unname(chisq.test(leiaf$previous.ponv,leiaf$ponv)[3])
tests[nt]="PREVIOUS PONV"
# PO OPIOIDS
table(leiaf$postoperative.opioids,leiaf$ponv)
##
## FALSE TRUE
## FALSE 367 135
## TRUE 899 428
chisq.test(leiaf$postoperative.opioids,leiaf$ponv)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$postoperative.opioids and leiaf$ponv
## X-squared = 4.6641, df = 1, p-value = 0.0308
nt=nt+1
p_values[nt]=unname(chisq.test(leiaf$postoperative.opioids,leiaf$ponv)[3])
tests[nt]="PO OPIOIDS"
#NON-SMOKER
table(leiaf$non.smoker,leiaf$ponv)
##
## FALSE TRUE
## FALSE 344 104
## TRUE 922 459
chisq.test(leiaf$non.smoker,leiaf$ponv)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$non.smoker and leiaf$ponv
## X-squared = 15.481, df = 1, p-value = 8.335e-05
nt=nt+1
p_values[nt]=unname(chisq.test(leiaf$non.smoker,leiaf$ponv)[3])
tests[nt]="NON SMOKER"
# SURGERY
table(leiaf$surgical.procedure,leiaf$ponv)
##
## FALSE TRUE
## Amputação de Membro 5 2
## Anexectomia/Ooforectomia 24 17
## Artoplastia Quadril 14 5
## Artrodese Espinhal 60 16
## Cirurgia biliodigestiva 5 1
## Cirurgia de Cabeça e Pescoço 26 5
## Cirurgia Gastrointestinal 308 130
## Cirurgia Plástica 33 18
## Cirurgias Ortopédicas 31 5
## Cirurgia Torácica 85 37
## Cistectomia 39 24
## Citorredução 33 18
## Esofagectomia 14 1
## Hepatectomia 39 14
## Histerectomia 71 33
## Histerectomia VLP 17 12
## Laparotomia Exploradora 71 25
## Linfadenectomia Extenso 18 10
## Mastectomia 172 84
## Nefrectomia 75 37
## Outros 47 29
## Pancreatectomia 9 15
## Prostatectomia 41 13
## Ressecção TU partes moles 10 6
## Setorectomia Mamária 19 6
t=chisq.test(leiaf$surgical.procedure,leiaf$ponv)
## Warning in chisq.test(leiaf$surgical.procedure, leiaf$ponv): Chi-squared
## approximation may be incorrect
t
##
## Pearson's Chi-squared test
##
## data: leiaf$surgical.procedure and leiaf$ponv
## X-squared = 40.617, df = 24, p-value = 0.01834
nt=nt+1
p_values[nt]=unname(t[3])
tests[nt]="SURGERY"
# CHRONIC OPIOID USER
table(leiaf$chronic.opioid.user,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1077 485
## TRUE 164 70
t=chisq.test(leiaf$chronic.opioid.user,leiaf$ponv)
t
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$chronic.opioid.user and leiaf$ponv
## X-squared = 0.075448, df = 1, p-value = 0.7836
nt=nt+1
p_values[nt]=unname(t[3])
tests[nt]="CHRONIC OPIOID USER"
# PREVIOUS CHEMOTHERAPY
table(leiaf$previous.chemotherapy,leiaf$ponv)
##
## FALSE TRUE
## FALSE 825 347
## TRUE 441 216
t=chisq.test(leiaf$previous.chemotherapy,leiaf$ponv)
t;nt=nt+1
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$previous.chemotherapy and leiaf$ponv
## X-squared = 1.9611, df = 1, p-value = 0.1614
p_values[nt]=unname(t[3])
tests[nt]="PREVIOUS CHEMOTHERAPY"
# HOW MANY MONTHS AGO RECEIVED CHEMOTHERAPY
comparenp(leiaf$how.many.months.ago.chemotherapy,leiaf$ponv,"how many months ago received chemotherapy")
## [1] "Mean how many months ago received chemotherapy in no PONV group: "
## [1] 13.49276
## [1] "Standard deviation in no PONV group"
## [1] 37.17242
## [1] "Mean how many months ago received chemotherapy in PONV group: "
## [1] 11.54681
## [1] "Standard deviation in PONV group"
## [1] 22.68942
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.1242484
##
## [1] "-------------------"
## [1] "-------------------"
t;nt=nt+1
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$previous.chemotherapy and leiaf$ponv
## X-squared = 1.9611, df = 1, p-value = 0.1614
p_values[nt]=unname(t[3])
tests[nt]="HOW MANY MONTHS AGO RECEIVED CHEMOTHERAPY"
# CHEMOTHERAPY EMETOGENICITY
table(leiaf$chemotherapy.emetogenicity,leiaf$ponv)
##
## FALSE TRUE
## a.minimal(<10%) 22 12
## b.low(10-30%) 167 82
## c.moderate(30-90%) 154 86
## d.high(>90%) 38 21
t=wilcox.test(rank(leiaf$chemotherapy.emetogenicity)~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: rank(leiaf$chemotherapy.emetogenicity) by leiaf$ponv
## W = 375070, p-value = 0.07231
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="CHEMOTHERAPY EMETOGENICITY"
# CHEMOTHERAPY INDUCED NAUSEA
table(leiaf$post.chemotherapy.nausea,leiaf$ponv)
##
## FALSE TRUE
## 1-No.Previous.Chemotherapy 804 336
## FALSE 249 73
## TRUE 213 154
t=chisq.test(leiaf$post.chemotherapy.nausea,leiaf$ponv)
t;nt=nt+1
##
## Pearson's Chi-squared test
##
## data: leiaf$post.chemotherapy.nausea and leiaf$ponv
## X-squared = 32.388, df = 2, p-value = 9.271e-08
p_values[nt]=unname(t[3])
tests[nt]="CHEMOTHERAPY INDUCED NAUSEA"
# CHEMOTHERAPY INDUCED VOMITING
table(leiaf$post.chemotherapy.vomiting,leiaf$ponv)
##
## FALSE TRUE
## FALSE 303 128
## TRUE 169 101
t=chisq.test(leiaf$post.chemotherapy.vomiting,leiaf$ponv)
t;nt=nt+1
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$post.chemotherapy.vomiting and leiaf$ponv
## X-squared = 4.1416, df = 1, p-value = 0.04184
p_values[nt]=unname(t[3])
tests[nt]="CHEMOTHERAPY INDUCED VOMITING"
# WHEN STOPED SMOKING
table(leiaf$when.stopped.smoking,leiaf$ponv)
##
## FALSE TRUE
## a.smokes 73 12
## b.1.month.ago 27 6
## c.1-6.months.ago 76 25
## d.>6months.ago 412 172
## e.never.smoked 678 348
t=wilcox.test(rank(leiaf$when.stopped.smoking)~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: rank(leiaf$when.stopped.smoking) by leiaf$ponv
## W = 320050, p-value = 8.904e-05
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="WHEN STOPED SMOKING"
# CIGAR PACKETS x YEARS
comparenp(leiaf$packets.years,leiaf$ponv,"Cigar Packets.Years")
## [1] "Mean Cigar Packets.Years in no PONV group: "
## [1] 8.19331
## [1] "Standard deviation in no PONV group"
## [1] 16.75298
## [1] "Mean Cigar Packets.Years in PONV group: "
## [1] 5.788298
## [1] "Standard deviation in PONV group"
## [1] 13.62073
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.005472456
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$packets.years ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$packets.years by leiaf$ponv
## W = 310610, p-value = 0.005472
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="CIGAR PACKETS x YEARS"
# SURGERY GROUP
table(leiaf$surgery.group,leiaf$ponv)
##
## FALSE TRUE
## Breast surgery 191 90
## Exploratory Laparotomy 71 25
## Gastrointenstinal Surgery 375 161
## Gynaecological Surgery 145 80
## Head and Neck Surgery 26 5
## Lymphadenectomy 18 10
## Ortopedic Surgery 110 28
## Other 57 35
## Plastic Surgery 33 18
## Thoracic Surgery 85 37
## Urologic Surgery 155 74
t=summary(glm(leiaf$ponv~leiaf$surgery.group,family = "binomial"))
t;nt=nt+1
##
## Call:
## glm(formula = leiaf$ponv ~ leiaf$surgery.group, family = "binomial")
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.9785 -0.8787 -0.8452 1.4381 1.9103
##
## Coefficients:
## Estimate Std. Error z value
## (Intercept) -0.75246 0.12785 -5.885
## leiaf$surgery.groupExploratory Laparotomy -0.29134 0.26539 -1.098
## leiaf$surgery.groupGastrointenstinal Surgery -0.09306 0.15882 -0.586
## leiaf$surgery.groupGynaecological Surgery 0.15776 0.18906 0.834
## leiaf$surgery.groupHead and Neck Surgery -0.89619 0.50479 -1.775
## leiaf$surgery.groupLymphadenectomy 0.16468 0.41461 0.397
## leiaf$surgery.groupOrtopedic Surgery -0.61581 0.24729 -2.490
## leiaf$surgery.groupOther 0.26476 0.24992 1.059
## leiaf$surgery.groupPlastic Surgery 0.14633 0.31970 0.458
## leiaf$surgery.groupThoracic Surgery -0.07927 0.23482 -0.338
## leiaf$surgery.groupUrologic Surgery 0.01310 0.19056 0.069
## Pr(>|z|)
## (Intercept) 3.97e-09 ***
## leiaf$surgery.groupExploratory Laparotomy 0.2723
## leiaf$surgery.groupGastrointenstinal Surgery 0.5579
## leiaf$surgery.groupGynaecological Surgery 0.4040
## leiaf$surgery.groupHead and Neck Surgery 0.0758 .
## leiaf$surgery.groupLymphadenectomy 0.6912
## leiaf$surgery.groupOrtopedic Surgery 0.0128 *
## leiaf$surgery.groupOther 0.2894
## leiaf$surgery.groupPlastic Surgery 0.6472
## leiaf$surgery.groupThoracic Surgery 0.7357
## leiaf$surgery.groupUrologic Surgery 0.9452
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 2258.2 on 1828 degrees of freedom
## Residual deviance: 2240.0 on 1818 degrees of freedom
## AIC: 2262
##
## Number of Fisher Scoring iterations: 4
p_values[nt]=0.01
tests[nt]="SURGERY GROUP"
table(leiaf$anesthesia.technique,leiaf$ponv)
##
## FALSE TRUE
## 1 405 153
## 2 11 3
## 3 9 2
## 4 730 365
## 5 107 40
## 6 4 0
t=chisq.test(leiaf$anesthesia.technique,leiaf$ponv)
## Warning in chisq.test(leiaf$anesthesia.technique, leiaf$ponv): Chi-squared
## approximation may be incorrect
t;nt=nt+1
##
## Pearson's Chi-squared test
##
## data: leiaf$anesthesia.technique and leiaf$ponv
## X-squared = 10.36, df = 5, p-value = 0.06566
p_values[nt]=unname(t[3])
tests[nt]="Anesthesia technique"
table(leiaf$neuraxial.opioid,leiaf$ponv)
##
## FALSE TRUE
## FALSE 522 200
## TRUE 744 363
t=chisq.test(leiaf$neuraxial.opioid,leiaf$ponv)
t;nt=nt+1
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$neuraxial.opioid and leiaf$ponv
## X-squared = 5.0784, df = 1, p-value = 0.02423
p_values[nt]=unname(t[3])
tests[nt]="NEURAXIAL OPIOIDS"
table(leiaf$intraoperative.opioid,leiaf$ponv)
##
## FALSE TRUE
## FALSE 95 32
## TRUE 1170 531
t=chisq.test(leiaf$intraoperative.opioid,leiaf$ponv)
t;nt=nt+1
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$intraoperative.opioid and leiaf$ponv
## X-squared = 1.737, df = 1, p-value = 0.1875
p_values[nt]=unname(t[3])
tests[nt]="INTRAOPERATIVE OPIOD"
table(leiaf$remifentanil,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1028 468
## TRUE 238 95
t=chisq.test(leiaf$remifentanil,leiaf$ponv)
t;nt=nt+1
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$remifentanil and leiaf$ponv
## X-squared = 0.8452, df = 1, p-value = 0.3579
p_values[nt]=unname(t[3])
tests[nt]="REMIFENTANIL"
table(leiaf$continuous.sufentanil,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1257 554
## TRUE 9 9
t=chisq.test(leiaf$continuous.sufentanil,leiaf$ponv)
t;nt=nt+1
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: leiaf$continuous.sufentanil and leiaf$ponv
## X-squared = 2.3061, df = 1, p-value = 0.1289
p_values[nt]=unname(t[3])
tests[nt]="CONTINUOUS SUFENTANIL"
#table(leiaf,leiaf$ponv)
comparenp(leiaf$fentanil.mcg,leiaf$ponv,"Fentanil in mcg")
## [1] "Mean Fentanil in mcg in no PONV group: "
## [1] 179.0009
## [1] "Standard deviation in no PONV group"
## [1] 252.4321
## [1] "Mean Fentanil in mcg in PONV group: "
## [1] 219.8313
## [1] "Standard deviation in PONV group"
## [1] 294.2206
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.005806661
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$fentanil.mcg ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$fentanil.mcg by leiaf$ponv
## W = 329810, p-value = 0.005807
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="FENTANIL DOSE"
comparenp(leiaf$sufentanil.mcg,leiaf$ponv,"Sufentanil in mcg")
## [1] "Mean Sufentanil in mcg in no PONV group: "
## [1] 23.88499
## [1] "Standard deviation in no PONV group"
## [1] 52.39576
## [1] "Mean Sufentanil in mcg in PONV group: "
## [1] 18.04121
## [1] "Standard deviation in PONV group"
## [1] 29.56713
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.1256867
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$sufentanil.mcg ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$sufentanil.mcg by leiaf$ponv
## W = 370560, p-value = 0.1257
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="SUFENTANIL DOSE"
# PACU TRAMADOL
table(leiaf$tramadol.pacu,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1217 527
## TRUE 49 36
t=fisher.test(leiaf$tramadol.pacu, leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$tramadol.pacu and leiaf$ponv
## p-value = 0.02191
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 1.057938 2.697320
## sample estimates:
## odds ratio
## 1.696101
p_values[nt]=unname(t[1])
tests[nt]="TRAMADOL PACU"
comparenp(leiaf$tramadol.dose.pacu,leiaf$ponv,"Tramadol (mg) in PACU")
## [1] "Mean Tramadol (mg) in PACU in no PONV group: "
## [1] 3.120063
## [1] "Standard deviation in no PONV group"
## [1] 16.27762
## [1] "Mean Tramadol (mg) in PACU in PONV group: "
## [1] 5.417407
## [1] "Standard deviation in PONV group"
## [1] 21.54929
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.01710378
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$tramadol.dose.pacu ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$tramadol.dose.pacu by leiaf$ponv
## W = 347310, p-value = 0.0171
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="TRAMADOL PACU DOSE"
# Intraoperative Ketamine
table(leiaf$intraoperative.ketamine,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1164 532
## TRUE 102 31
t=fisher.test(leiaf$intraoperative.ketamine, leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$intraoperative.ketamine and leiaf$ponv
## p-value = 0.06334
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.424258 1.017695
## sample estimates:
## odds ratio
## 0.6651092
p_values[nt]=unname(t[1])
tests[nt]="KETAMINE"
comparenp(leiaf$ketamine.dose,leiaf$ponv,"Ketamine dose")
## [1] "Mean Ketamine dose in no PONV group: "
## [1] 2.624901
## [1] "Standard deviation in no PONV group"
## [1] 11.79795
## [1] "Mean Ketamine dose in PONV group: "
## [1] 1.46714
## [1] "Standard deviation in PONV group"
## [1] 7.668179
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.05335759
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$ketamine.dose ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$ketamine.dose by leiaf$ponv
## W = 365130, p-value = 0.05336
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="KETAMINE DOSE"
# Intraoperative morphine
table(leiaf$intraoperative.morphine,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1060 479
## TRUE 205 83
t=fisher.test(leiaf$intraoperative.morphine,leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$intraoperative.morphine and leiaf$ponv
## p-value = 0.4867
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.6704286 1.1898227
## sample estimates:
## odds ratio
## 0.8960095
p_values[nt]=unname(t[1])
tests[nt]="INTRAOPERATIVE MORPHINE"
comparenp(leiaf$intraoperative.morphine.dose,leiaf$ponv,"Intraoperative morphine dose")
## [1] "Mean Intraoperative morphine dose in no PONV group: "
## [1] 0.7133758
## [1] "Standard deviation in no PONV group"
## [1] 1.942257
## [1] "Mean Intraoperative morphine dose in PONV group: "
## [1] 0.6167558
## [1] "Standard deviation in PONV group"
## [1] 1.749797
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.5220393
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$intraoperative.morphine.dose ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$intraoperative.morphine.dose by leiaf$ponv
## W = 356450, p-value = 0.522
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="INTRAOPERATIVE MORPHINE DOSE"
comparenp(leiaf$intraoperative.antiemectics.count,leiaf$ponv,"Number of intraoperative antiemetic drugs")
## [1] "Mean Number of intraoperative antiemetic drugs in no PONV group: "
## [1] 1.396524
## [1] "Standard deviation in no PONV group"
## [1] 0.7017453
## [1] "Mean Number of intraoperative antiemetic drugs in PONV group: "
## [1] 1.383659
## [1] "Standard deviation in PONV group"
## [1] 0.7319958
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.4026941
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$intraoperative.antiemectics.count ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$intraoperative.antiemectics.count by leiaf$ponv
## W = 364330, p-value = 0.4027
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="NUMBER OF INTRAOPERATIVE ANTIEMETIC DRUGS"
# INTRAOPERATIVE ONDANSETRON
table(leiaf$ondansetron.intraoperative,leiaf$ponv)
##
## FALSE TRUE
## FALSE 262 102
## TRUE 1004 461
t=fisher.test(leiaf$ondansetron.intraoperative,leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$ondansetron.intraoperative and leiaf$ponv
## p-value = 0.228
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.9095345 1.5367987
## sample estimates:
## odds ratio
## 1.179285
p_values[nt]=unname(t[1])
tests[nt]="INTRAOPERATIVE ONDANSETRON"
comparenp(leiaf$intraoperative.ondansetron.dose,leiaf$ponv,"Intraoperative ondansetron dose")
## [1] "Mean Intraoperative ondansetron dose in no PONV group: "
## [1] 6.088678
## [1] "Standard deviation in no PONV group"
## [1] 3.259275
## [1] "Mean Intraoperative ondansetron dose in PONV group: "
## [1] 6.327402
## [1] "Standard deviation in PONV group"
## [1] 3.112781
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.1388728
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$intraoperative.ondansetron.dose ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$intraoperative.ondansetron.dose by leiaf$ponv
## W = 343070, p-value = 0.1389
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="INTRAOPERATIVE ONDANSETRON DOSE"
# INTRAOPERATIVE DEXAMETHASONE
table(leiaf$intraoperative.dexamethasone,leiaf$ponv)
##
## FALSE TRUE
## FALSE 527 278
## TRUE 739 285
t=fisher.test(leiaf$intraoperative.dexamethasone,leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$intraoperative.dexamethasone and leiaf$ponv
## p-value = 0.002202
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.5958982 0.8971092
## sample estimates:
## odds ratio
## 0.7312221
p_values[nt]=unname(t[1])
tests[nt]="INTRAOPERATIVE DEXAMETHASONE"
comparenp(leiaf$dexamethasone.dose,leiaf$ponv,"Intraoperative dexamethasone dose")
## [1] "Mean Intraoperative dexamethasone dose in no PONV group: "
## [1] 3.970705
## [1] "Standard deviation in no PONV group"
## [1] 3.810894
## [1] "Mean Intraoperative dexamethasone dose in PONV group: "
## [1] 3.385305
## [1] "Standard deviation in PONV group"
## [1] 3.785582
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.002385579
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$dexamethasone.dose ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$dexamethasone.dose by leiaf$ponv
## W = 382100, p-value = 0.002386
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="INTRAOPERATIVE DEXAMETHASONE DOSE"
# INTRAOPERATIVE DIMENIDRATE
table(leiaf$intraoperative.dimenidrate,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1261 554
## TRUE 5 9
t=fisher.test(leiaf$intraoperative.dimenidrate,leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$intraoperative.dimenidrate and leiaf$ponv
## p-value = 0.01538
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 1.225402 15.624013
## sample estimates:
## odds ratio
## 4.093916
p_values[nt]=unname(t[1])
tests[nt]="INTRAOPERATIVE DIMENIDRATE"
comparenp(leiaf$intraoperative.dimenidrate.dose,leiaf$ponv,"Intraoperative dimenidrate dose")
## [1] "Mean Intraoperative dimenidrate dose in no PONV group: "
## [1] 0.1342812
## [1] "Standard deviation in no PONV group"
## [1] 2.33163
## [1] "Mean Intraoperative dimenidrate dose in PONV group: "
## [1] 0.5506217
## [1] "Standard deviation in PONV group"
## [1] 4.45006
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.006432522
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$intraoperative.dimenidrate.dose ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$intraoperative.dimenidrate.dose by leiaf$ponv
## W = 352090, p-value = 0.006433
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="INTRAOPERATIVE DIMENIDRATE DOSE"
# INTRAOPERATIVE METOCLOPRAMIDE
table(leiaf$Intraoperative.metoclopramide,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1246 539
## TRUE 20 24
t=fisher.test(leiaf$Intraoperative.metoclopramide,leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$Intraoperative.metoclopramide and leiaf$ponv
## p-value = 0.001329
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 1.453750 5.341568
## sample estimates:
## odds ratio
## 2.772284
p_values[nt]=unname(t[1])
tests[nt]="INTRAOPERATIVE METOCLOPRAMIDE"
comparenp(leiaf$metoclopramide.dose,leiaf$ponv,"Intraoperative metoclopramide dose")
## [1] "Mean Intraoperative metoclopramide dose in no PONV group: "
## [1] 0.1579779
## [1] "Standard deviation in no PONV group"
## [1] 1.247418
## [1] "Mean Intraoperative metoclopramide dose in PONV group: "
## [1] 0.4262877
## [1] "Standard deviation in PONV group"
## [1] 2.021984
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.0005490021
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$metoclopramide.dose ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$metoclopramide.dose by leiaf$ponv
## W = 346820, p-value = 0.000549
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="INTRAOPERATIVE METOCLOPRAMIDE DOSE"
# INTRAOPERATIVE DROPERIDOL
table(leiaf$intraoperative.droperidol,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1260 555
## TRUE 6 8
t=fisher.test(leiaf$intraoperative.droperidol,leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$intraoperative.droperidol and leiaf$ponv
## p-value = 0.04169
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.915511 10.630256
## sample estimates:
## odds ratio
## 3.02496
p_values[nt]=unname(t[1])
tests[nt]="INTRAOPERATIVE DROPERIDOL"
comparenp(leiaf$droperidol.dose,leiaf$ponv,"Intraoperative droperidol dose")
## [1] "Mean Intraoperative droperidol dose in no PONV group: "
## [1] 0.02409163
## [1] "Standard deviation in no PONV group"
## [1] 0.3674129
## [1] "Mean Intraoperative droperidol dose in PONV group: "
## [1] 0.06660746
## [1] "Standard deviation in PONV group"
## [1] 0.5928132
## [1] "hypothesis test p-value"
## [[1]]
## [1] 0.03225235
##
## [1] "-------------------"
## [1] "-------------------"
t=wilcox.test(leiaf$droperidol.dose ~leiaf$ponv)
t;nt=nt+1
##
## Wilcoxon rank sum test with continuity correction
##
## data: leiaf$droperidol.dose by leiaf$ponv
## W = 353010, p-value = 0.03225
## alternative hypothesis: true location shift is not equal to 0
p_values[nt]=unname(t[3])
tests[nt]="INTRAOPERATIVE DROPERIDOL DOSE"
# ONDANSETRON
table(leiaf$regular.ondansetron,leiaf$ponv)
##
## FALSE TRUE
## FALSE 841 359
## TRUE 423 203
t=fisher.test(leiaf$regular.ondansetron,leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$regular.ondansetron and leiaf$ponv
## p-value = 0.2855
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.9074592 1.3910059
## sample estimates:
## odds ratio
## 1.124159
p_values[nt]=unname(t[1])
tests[nt]="ONDANSETRON"
# DEXAMETHASONE
table(leiaf$regular.dexamethasone,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1171 537
## TRUE 91 26
t=fisher.test(leiaf$regular.dexamethasone,leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$regular.dexamethasone and leiaf$ponv
## p-value = 0.03845
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.3819941 0.9860945
## sample estimates:
## odds ratio
## 0.6231861
p_values[nt]=unname(t[1])
tests[nt]="DEXAMETHASONE"
# DIMENIDRATE
table(leiaf$regular.dimenidrate,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1254 562
## TRUE 8 1
t=fisher.test(leiaf$regular.dimenidrate,leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$regular.dimenidrate and leiaf$ponv
## p-value = 0.2896
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.006278657 2.089628765
## sample estimates:
## odds ratio
## 0.2790846
p_values[nt]=unname(t[1])
tests[nt]="DIMENIDRATE"
# DROPERIDOL
table(leiaf$regular.droperidol,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1168 514
## TRUE 2 4
t=fisher.test(leiaf$regular.droperidol,leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$regular.droperidol and leiaf$ponv
## p-value = 0.0757
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.6483642 50.3284491
## sample estimates:
## odds ratio
## 4.540194
p_values[nt]=unname(t[1])
tests[nt]="DROPERIDOL"
# METOCLOPRAMIDE
table(leiaf$regular.metoclopramide,leiaf$ponv)
##
## FALSE TRUE
## FALSE 1109 503
## TRUE 153 60
t=fisher.test(leiaf$regular.metoclopramide,leiaf$ponv)
t;nt=nt+1
##
## Fisher's Exact Test for Count Data
##
## data: leiaf$regular.metoclopramide and leiaf$ponv
## p-value = 0.3862
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.6187898 1.1964026
## sample estimates:
## odds ratio
## 0.8646648
p_values[nt]=unname(t[1])
tests[nt]="METOCLOPRAMIDE"
# Full model
col1=c("Previous full model","Sex","Age","Previous PONV","Previous CINV", "Number of intraoperative antiemectics","surgical procedure","Neuraxial opioid usage","Fentanyl dose")
m1=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+surgical.procedure+neuraxial.opioid+fentanil.mcg, family="binomial"))
# Remove 1st
previousAIC=m1[11]$aic
col2=rep(0,9)
col3=rep(0,9)
col2[1]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+surgical.procedure+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[2]=(glm(data=leiaf,ponv~when.stopped.smoking+age+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+surgical.procedure+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[3]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+surgical.procedure+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[4]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+post.chemotherapy.nausea+intraoperative.antiemectics.count+surgical.procedure+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[5]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+intraoperative.antiemectics.count+surgical.procedure+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[6]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea++surgical.procedure+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[7]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[8]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+surgical.procedure+fentanil.mcg, family="binomial"))[11]$aic
col2[9]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+surgical.procedure+neuraxial.opioid, family="binomial"))[11]$aic
col3=col2-previousAIC
data.frame(Removed.Predictor=col1,newAIC=col2,Difference=col3)
## Removed.Predictor newAIC Difference
## 1 Previous full model 2141.936 0.0000000
## 2 Sex 2164.748 22.8116338
## 3 Age 2147.856 5.9195076
## 4 Previous PONV 2178.048 36.1120089
## 5 Previous CINV 2150.959 9.0225432
## 6 Number of intraoperative antiemectics 2141.050 -0.8862122
## 7 surgical procedure 2128.157 -13.7788472
## 8 Neuraxial opioid usage 2142.546 0.6099881
## 9 Fentanyl dose 2148.796 6.8600735
## Surgical procedure out
## Next
m1=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+neuraxial.opioid+fentanil.mcg, family="binomial"))
col1=c("Previous full model","Sex","Age","Previous PONV","Previous CINV", "Number of intraoperative antiemectics","Neuraxial opioid usage","Fentanyl dose")
previousAIC=m1[11]$aic
col2=rep(0,8)
col3=rep(0,8)
col2[1]=glm(data=leiaf,ponv~when.stopped.smoking+ sex+age+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+neuraxial.opioid+fentanil.mcg, family="binomial")[11]$aic
col2[2]=glm(data=leiaf,ponv~when.stopped.smoking+age+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+neuraxial.opioid+fentanil.mcg, family="binomial")[11]$aic
col2[3]=glm(data=leiaf,ponv~when.stopped.smoking+sex+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+neuraxial.opioid+fentanil.mcg, family="binomial")[11]$aic
col2[4]=glm(data=leiaf,ponv~when.stopped.smoking+sex+age+post.chemotherapy.nausea+intraoperative.antiemectics.count+neuraxial.opioid+fentanil.mcg, family="binomial")[11]$aic
col2[5]=glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+intraoperative.antiemectics.count+neuraxial.opioid+fentanil.mcg, family="binomial")[11]$aic
col2[6]=glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+neuraxial.opioid+fentanil.mcg, family="binomial")[11]$aic
col2[7]=glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+fentanil.mcg, family="binomial")[11]$aic
col2[8]=glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+intraoperative.antiemectics.count+neuraxial.opioid, family="binomial")[11]$aic
col3=col2-previousAIC
data.frame(Removed.Predictor=col1,newAIC=col2,Difference=col3)
## Removed.Predictor newAIC Difference
## 1 Previous full model 2128.157 0.0000000
## 2 Sex 2151.779 23.6215562
## 3 Age 2135.821 7.6641806
## 4 Previous PONV 2165.041 36.8840768
## 5 Previous CINV 2135.023 6.8654041
## 6 Number of intraoperative antiemectics 2127.303 -0.8546409
## 7 Neuraxial opioid usage 2134.472 6.3150227
## 8 Fentanyl dose 2134.960 6.8024417
## Number of intraoperative antiemetics out
## Next
m1=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+neuraxial.opioid+fentanil.mcg, family="binomial"))
col1=c("Previous full model","Sex","Age","Previous PONV","Previous CINV", "Neuraxial opioid usage","Fentanyl dose")
previousAIC=m1[11]$aic
col2=rep(0,7)
col3=rep(0,7)
col2[1]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[2]=(glm(data=leiaf,ponv~when.stopped.smoking+age+previous.ponv+post.chemotherapy.nausea+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[3]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+previous.ponv+post.chemotherapy.nausea+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[4]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+post.chemotherapy.nausea+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[5]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+neuraxial.opioid+fentanil.mcg, family="binomial"))[11]$aic
col2[6]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+fentanil.mcg, family="binomial"))[11]$aic
col2[7]=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+neuraxial.opioid, family="binomial"))[11]$aic
col3=col2-previousAIC
data.frame(Removed.Predictor=col1,newAIC=col2,Difference=col3)
## Removed.Predictor newAIC Difference
## 1 Previous full model 2127.303 0.000000
## 2 Sex 2150.560 23.257707
## 3 Age 2134.275 6.972043
## 4 Previous PONV 2164.696 37.393559
## 5 Previous CINV 2133.998 6.695129
## 6 Neuraxial opioid usage 2133.100 5.797207
## 7 Fentanyl dose 2134.351 7.048242
library("generalhoslem")
## Loading required package: reshape
## Loading required package: MASS
m1=(glm(data=leiaf,ponv~when.stopped.smoking+sex+age+previous.ponv+post.chemotherapy.nausea+neuraxial.opioid+fentanil.mcg, family="binomial"))
summary(m1)
##
## Call:
## glm(formula = ponv ~ when.stopped.smoking + sex + age + previous.ponv +
## post.chemotherapy.nausea + neuraxial.opioid + fentanil.mcg,
## family = "binomial", data = leiaf)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.6374 -0.8476 -0.6704 1.1628 2.3454
##
## Coefficients:
## Estimate Std. Error z value
## (Intercept) -1.5251876 0.4049769 -3.766
## when.stopped.smokingb.1.month.ago 0.4812235 0.5678402 0.847
## when.stopped.smokingc.1-6.months.ago 0.8099373 0.4031277 2.009
## when.stopped.smokingd.>6months.ago 1.0881318 0.3391959 3.208
## when.stopped.smokinge.never.smoked 1.1479601 0.3332188 3.445
## sexMale -0.5756266 0.1160733 -4.959
## age -0.0115456 0.0038560 -2.994
## previous.ponvTRUE 0.7779238 0.1231098 6.319
## post.chemotherapy.nauseaFALSE -0.2718817 0.1532979 -1.774
## post.chemotherapy.nauseaTRUE 0.3033956 0.1337552 2.268
## neuraxial.opioidTRUE 0.3066194 0.1104424 2.776
## fentanil.mcg 0.0005837 0.0001933 3.019
## Pr(>|z|)
## (Intercept) 0.000166 ***
## when.stopped.smokingb.1.month.ago 0.396737
## when.stopped.smokingc.1-6.months.ago 0.044523 *
## when.stopped.smokingd.>6months.ago 0.001337 **
## when.stopped.smokinge.never.smoked 0.000571 ***
## sexMale 7.08e-07 ***
## age 0.002751 **
## previous.ponvTRUE 2.63e-10 ***
## post.chemotherapy.nauseaFALSE 0.076137 .
## post.chemotherapy.nauseaTRUE 0.023312 *
## neuraxial.opioidTRUE 0.005498 **
## fentanil.mcg 0.002532 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 2258.2 on 1828 degrees of freedom
## Residual deviance: 2103.3 on 1817 degrees of freedom
## AIC: 2127.3
##
## Number of Fisher Scoring iterations: 4
logitgof(leiaf$ponv,fitted(m1),g=2)
##
## Hosmer and Lemeshow test (binary model)
##
## data: leiaf$ponv, fitted(m1)
## X-squared = 0.24088, df = 0, p-value < 2.2e-16
m2=(glm(data=leiaf,ponv~Apfel, family="binomial"))
summary(m2)
##
## Call:
## glm(formula = ponv ~ Apfel, family = "binomial", data = leiaf)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.2075 -0.9788 -0.7765 1.1476 2.1300
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.15931 0.15407 -14.016 <2e-16 ***
## Apfel 0.55744 0.05775 9.654 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 2258.2 on 1828 degrees of freedom
## Residual deviance: 2156.6 on 1827 degrees of freedom
## AIC: 2160.6
##
## Number of Fisher Scoring iterations: 4
logitgof(leiaf$ponv,fitted(m2),g=2)
##
## Hosmer and Lemeshow test (binary model)
##
## data: leiaf$ponv, fitted(m2)
## X-squared = 0.05309, df = 0, p-value < 2.2e-16
rocobj1=plot.roc(leiaf$ponv,fitted(m1),percent=TRUE,col="red",print.auc=TRUE,print.auc.y=40,xlim=c(101,-1),ylim=c(0,100))
rocobj2=plot.roc(leiaf$ponv,fitted(m2),percent=TRUE,col="blue",add=TRUE,print.auc=TRUE,print.auc.y=30,xlim=c(101,-1),ylim=c(0,100))
testobj=roc.test(rocobj1,rocobj2)
text(50, 50, labels=paste("p-value =", format.pval(testobj$p.value)), adj=c(0, .5))
legend("bottomright", legend=c("Apfel", "New Model"), col=c("blue", "red"), lwd=2)
rocobj1=plot.roc(leiaf$ponv,fitted(m1),percent=TRUE,col="red",print.auc=TRUE,print.auc.y=40,xlim=c(101,-1),ylim=c(0,100),xlab="Especificidade",ylab="Sensibilidade")
rocobj2=plot.roc(leiaf$ponv,fitted(m2),percent=TRUE,col="blue",add=TRUE,print.auc=TRUE,print.auc.y=30,xlim=c(101,-1),ylim=c(0,100))
testobj=roc.test(rocobj1,rocobj2)
text(50, 50, labels=paste("p-valor =", format.pval(testobj$p.value)), adj=c(0, .5))
legend("bottomright", legend=c("Apfel", "Novo modelo"), col=c("blue", "red"), lwd=2)
p_values=unlist(p_values)
# NUMBER OF HYPOTHESIS TESTS
print(nt)
## [1] 45
# BONFERRONI's alpha (CONSERVATIVE)
new_alpha=0.05 / nt
print(new_alpha)
## [1] 0.001111111
data.frame(tests,p=p.adjust(p_values,method="bonferroni"))
## tests p
## 1 SEX 7.907112e-09
## 2 APFEL 3.083087e-21
## 3 AGE 7.180836e-03
## 4 PREVIOUS PONV 1.183946e-15
## 5 PO OPIOIDS 1.000000e+00
## 6 NON SMOKER 3.750887e-03
## 7 SURGERY 8.253697e-01
## 8 CHRONIC OPIOID USER 1.000000e+00
## 9 PREVIOUS CHEMOTHERAPY 1.000000e+00
## 10 HOW MANY MONTHS AGO RECEIVED CHEMOTHERAPY 1.000000e+00
## 11 CHEMOTHERAPY EMETOGENICITY 1.000000e+00
## 12 CHEMOTHERAPY INDUCED NAUSEA 4.171783e-06
## 13 CHEMOTHERAPY INDUCED VOMITING 1.000000e+00
## 14 WHEN STOPED SMOKING 4.006914e-03
## 15 CIGAR PACKETS x YEARS 2.462605e-01
## 16 SURGERY GROUP 4.500000e-01
## 17 Anesthesia technique 1.000000e+00
## 18 NEURAXIAL OPIOIDS 1.000000e+00
## 19 INTRAOPERATIVE OPIOD 1.000000e+00
## 20 REMIFENTANIL 1.000000e+00
## 21 CONTINUOUS SUFENTANIL 1.000000e+00
## 22 FENTANIL DOSE 2.612997e-01
## 23 SUFENTANIL DOSE 1.000000e+00
## 24 TRAMADOL PACU 9.861144e-01
## 25 TRAMADOL PACU DOSE 7.696702e-01
## 26 KETAMINE 1.000000e+00
## 27 KETAMINE DOSE 1.000000e+00
## 28 INTRAOPERATIVE MORPHINE 1.000000e+00
## 29 INTRAOPERATIVE MORPHINE DOSE 1.000000e+00
## 30 NUMBER OF INTRAOPERATIVE ANTIEMETIC DRUGS 1.000000e+00
## 31 INTRAOPERATIVE ONDANSETRON 1.000000e+00
## 32 INTRAOPERATIVE ONDANSETRON DOSE 1.000000e+00
## 33 INTRAOPERATIVE DEXAMETHASONE 9.906817e-02
## 34 INTRAOPERATIVE DEXAMETHASONE DOSE 1.073511e-01
## 35 INTRAOPERATIVE DIMENIDRATE 6.921735e-01
## 36 INTRAOPERATIVE DIMENIDRATE DOSE 2.894635e-01
## 37 INTRAOPERATIVE METOCLOPRAMIDE 5.978573e-02
## 38 INTRAOPERATIVE METOCLOPRAMIDE DOSE 2.470510e-02
## 39 INTRAOPERATIVE DROPERIDOL 1.000000e+00
## 40 INTRAOPERATIVE DROPERIDOL DOSE 1.000000e+00
## 41 ONDANSETRON 1.000000e+00
## 42 DEXAMETHASONE 1.000000e+00
## 43 DIMENIDRATE 1.000000e+00
## 44 DROPERIDOL 1.000000e+00
## 45 METOCLOPRAMIDE 1.000000e+00
# USING FALSE DISCOVERY RATE
## Benjamini, Y., and Yekutieli, D. (2001). The control of the false discovery rate in
##multiple testing under dependency. Annals of Statistics 29, 1165–1188.
data.frame(tests,p=p.adjust(p_values,method="BH"))
## tests p
## 1 SEX 2.635704e-09
## 2 APFEL 3.083087e-21
## 3 AGE 1.025834e-03
## 4 PREVIOUS PONV 5.919730e-16
## 5 PO OPIOIDS 6.597071e-02
## 6 NON SMOKER 6.678190e-04
## 7 SURGERY 4.585387e-02
## 8 CHRONIC OPIOID USER 7.835641e-01
## 9 PREVIOUS CHEMOTHERAPY 2.075046e-01
## 10 HOW MANY MONTHS AGO RECEIVED CHEMOTHERAPY 2.075046e-01
## 11 CHEMOTHERAPY EMETOGENICITY 1.122043e-01
## 12 CHEMOTHERAPY INDUCED NAUSEA 1.042946e-06
## 13 CHEMOTHERAPY INDUCED VOMITING 7.531647e-02
## 14 WHEN STOPED SMOKING 6.678190e-04
## 15 CIGAR PACKETS x YEARS 2.009998e-02
## 16 SURGERY GROUP 3.000000e-02
## 17 Anesthesia technique 1.055240e-01
## 18 NEURAXIAL OPIOIDS 5.450646e-02
## 19 INTRAOPERATIVE OPIOD 2.344031e-01
## 20 REMIFENTANIL 4.026526e-01
## 21 CONTINUOUS SUFENTANIL 1.812203e-01
## 22 FENTANIL DOSE 2.009998e-02
## 23 SUFENTANIL DOSE 1.812203e-01
## 24 TRAMADOL PACU 5.190076e-02
## 25 TRAMADOL PACU DOSE 4.527472e-02
## 26 KETAMINE 1.055240e-01
## 27 KETAMINE DOSE 9.234967e-02
## 28 INTRAOPERATIVE MORPHINE 5.093304e-01
## 29 INTRAOPERATIVE MORPHINE DOSE 5.339038e-01
## 30 NUMBER OF INTRAOPERATIVE ANTIEMETIC DRUGS 4.314579e-01
## 31 INTRAOPERATIVE ONDANSETRON 2.772973e-01
## 32 INTRAOPERATIVE ONDANSETRON DOSE 1.893720e-01
## 33 INTRAOPERATIVE DEXAMETHASONE 9.759188e-03
## 34 INTRAOPERATIVE DEXAMETHASONE DOSE 9.759188e-03
## 35 INTRAOPERATIVE DIMENIDRATE 4.326084e-02
## 36 INTRAOPERATIVE DIMENIDRATE DOSE 2.067596e-02
## 37 INTRAOPERATIVE METOCLOPRAMIDE 6.642858e-03
## 38 INTRAOPERATIVE METOCLOPRAMIDE DOSE 3.088137e-03
## 39 INTRAOPERATIVE DROPERIDOL 7.531647e-02
## 40 INTRAOPERATIVE DROPERIDOL DOSE 6.597071e-02
## 41 ONDANSETRON 3.342065e-01
## 42 DEXAMETHASONE 7.523514e-02
## 43 DIMENIDRATE 3.342065e-01
## 44 DROPERIDOL 1.135460e-01
## 45 METOCLOPRAMIDE 4.238811e-01