library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(table1)
##
## Attaching package: 'table1'
## The following objects are masked from 'package:base':
##
## units, units<-
library(explore)
## Warning: package 'explore' was built under R version 4.1.2
library(GGally)
## Warning: package 'GGally' was built under R version 4.1.2
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 4.1.2
## Registered S3 method overwritten by 'GGally':
## method from
## +.gg ggplot2
##
## Attaching package: 'GGally'
## The following object is masked from 'package:explore':
##
## rescale01
library(epiDisplay)
## Warning: package 'epiDisplay' was built under R version 4.1.2
## Loading required package: foreign
## Loading required package: survival
## Loading required package: MASS
##
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
##
## select
## Loading required package: nnet
## Warning: package 'nnet' was built under R version 4.1.2
##
## Attaching package: 'epiDisplay'
## The following object is masked from 'package:ggplot2':
##
## alpha
library(rms)
## Loading required package: Hmisc
## Loading required package: lattice
##
## Attaching package: 'lattice'
## The following object is masked from 'package:epiDisplay':
##
## dotplot
## Loading required package: Formula
##
## Attaching package: 'Hmisc'
## The following object is masked from 'package:explore':
##
## describe
## The following objects are masked from 'package:table1':
##
## label, label<-, units
## The following objects are masked from 'package:dplyr':
##
## src, summarize
## The following objects are masked from 'package:base':
##
## format.pval, units
## Loading required package: SparseM
##
## Attaching package: 'SparseM'
## The following object is masked from 'package:base':
##
## backsolve
## Registered S3 method overwritten by 'rms':
## method from
## print.lrtest epiDisplay
##
## Attaching package: 'rms'
## The following object is masked from 'package:epiDisplay':
##
## lrtest
library(BMA)
## Warning: package 'BMA' was built under R version 4.1.2
## Loading required package: leaps
## Warning: package 'leaps' was built under R version 4.1.2
## Loading required package: robustbase
## Warning: package 'robustbase' was built under R version 4.1.2
##
## Attaching package: 'robustbase'
## The following object is masked from 'package:survival':
##
## heart
## Loading required package: inline
## Warning: package 'inline' was built under R version 4.1.2
## Loading required package: rrcov
## Warning: package 'rrcov' was built under R version 4.1.2
## Scalable Robust Estimators with High Breakdown Point (version 1.6-0)
library(DescTools)
## Warning: package 'DescTools' was built under R version 4.1.2
##
## Attaching package: 'DescTools'
## The following object is masked from 'package:rrcov':
##
## Cov
## The following objects are masked from 'package:Hmisc':
##
## %nin%, Label, Mean, Quantile
library(boot)
##
## Attaching package: 'boot'
## The following object is masked from 'package:robustbase':
##
## salinity
## The following object is masked from 'package:lattice':
##
## melanoma
## The following object is masked from 'package:survival':
##
## aml
library(simpleboot)
## Warning: package 'simpleboot' was built under R version 4.1.2
## Simple Bootstrap Routines (1.1-7)
pai <- read.csv("C:/Users/Macbook pro 2015/Desktop/pai.csv")
head(pai)
## id age age.group sex hos.stay first.aid f.aid moi pre.ad over.6h shock MESS A
## 1 1 16 1 1 4 splint 0 1 5.0 1 0 6 2
## 2 2 20 1 1 7 splint 0 1 5.5 1 1 8 3
## 3 3 23 1 1 8 splint 0 1 8.0 1 0 8 2
## 4 4 42 2 1 14 splint 0 1 3.5 1 0 11 4
## 5 5 38 2 1 5 splint 0 1 1.0 0 0 5 2
## 6 6 40 2 1 5 splint 0 1 8.5 1 1 8 2
## B B. C D le.isc ali ost frac cb.inj co.inj CTA.d CTA ad.surg ac.surg surg.d
## 1 2 4 0 0 1 0 TPF 1 0 0 0.0 0 5.5 10.5 4.0
## 2 2 4 1 0 1 0 TPF 1 0 0 0.0 0 5.5 11.0 2.0
## 3 3 6 0 0 2 0 TPF 1 0 0 1.0 1 4.5 12.5 4.5
## 4 3 6 0 1 2 0 BW 0 0 0 0.0 0 7.0 10.5 2.0
## 5 2 2 0 1 1 0 KJD 1 0 0 3.0 1 4.5 5.5 2.5
## 6 2 4 1 1 1 0 TPF 1 0 0 2.5 1 4.5 13.0 3.0
## orth acs fasc AC w.AC d.AC LC w.LC d.LC SPC w.SPC d.SPC DPC w.DPC d.DPC
## 1 orth 0 1 0 0 1 0 0 1 2 0 0 2 0 0
## 2 orth 0 1 2 0 0 2 0 0 0 0 1 2 0 0
## 3 orth 1 1 2 0 0 2 0 0 2 0 0 2 0 0
## 4 orth 0 1 2 0 0 2 0 0 0 0 1 2 0 0
## 5 orth 1 1 2 0 0 2 0 0 2 0 0 1 1 0
## 6 orth 0 1 2 0 0 2 0 0 2 0 0 2 0 0
## myonec myores myoweak myo softi ost.ttt pri.am sec.am t.am pai.loc pai.type
## 1 2 1 0 2 0 EF 0 0 0 1 1
## 2 1 1 0 1 1 EF 0 0 0 1 1
## 3 0 0 0 0 0 EF 0 0 0 1 1
## 4 1 1 0 1 1 splint 0 0 0 1 1
## 5 0 0 1 1 0 DR, IMN 0 0 0 0 1
## 6 0 0 0 0 0 EF 0 0 0 1 1
## pai.len pai.ttt pvi pvi.type pvi.ttt transf po.motor po.sens pulse24 po.tem
## 1 5.0 2 0 0 0 0 1 1 1 1
## 2 3.0 2 0 0 0 0 1 1 1 1
## 3 2.0 1 1 1 1 2 RBC 1 1 1 1
## 4 1.5 1 0 0 0 0 1 1 1 1
## 5 5.0 2 0 0 0 0 1 1 1 1
## 6 3.0 2 0 0 0 0 1 1 1 1
## result myolytic AKI hyperkal reperf po.myores vas.com redo softi.inf HB0 HCT0
## 1 4 1 0 1 2 0 0 0 0 120 36.7
## 2 4 0 0 0 0 0 0 0 0 132 41.2
## 3 4 1 0 0 1 0 0 0 0 120 35.0
## 4 4 0 1 0 1 0 0 0 0 133 40.9
## 5 4 0 0 0 0 0 0 0 0 122 38.4
## 6 4 0 0 0 0 0 0 0 0 133 36.9
## WBC0 fu.dus late.am le.dys
## 1 8.90 0 0 2
## 2 12.10 0 0 1
## 3 10.30 0 0 1
## 4 12.61 0 0 1
## 5 8.83 0 0 1
## 6 17.18 0 0 1
fac= pai[, c("age","sex","moi","shock","softi","pai.loc","pai.type","acs","ali","pre.ad","ac.surg", "pri.am")]
head(fac)
## age sex moi shock softi pai.loc pai.type acs ali pre.ad ac.surg pri.am
## 1 16 1 1 0 0 1 1 0 0 5.0 10.5 0
## 2 20 1 1 1 1 1 1 0 0 5.5 11.0 0
## 3 23 1 1 0 0 1 1 1 0 8.0 12.5 0
## 4 42 1 1 0 1 1 1 0 0 3.5 10.5 0
## 5 38 1 1 0 0 0 1 1 0 1.0 5.5 0
## 6 40 1 1 1 0 1 1 0 0 8.5 13.0 0
t48= filter(pai, pre.ad< 48)
dim(t48)
## [1] 116 79
sec= filter(pai, pri.am==0)
dim(sec)
## [1] 111 79
frac= filter(sec, frac==1)
dim(frac)
## [1] 97 79
func= filter(sec, sec.am==0)
isc= filter(pai, ali==1)
dim(isc)
## [1] 25 79
soft= filter(pai, softi==1)
dim(soft)
## [1] 25 79
The following variables of the data were used in this part: moi: mechanism of injury (0,1), softi: severity of soft tissue injury (0,1), frac: associated bone fractures (0,1), pai.loc: location of arterial lession (0: ATK, 1:BTK), pai.type: type of PA injury (1,2,3), acs: suspected acute compartment syndrome (0,1), ali: acute limb ischemia (0,1), le.isc: limb ischemia (1,2,3), pre.ad: time to admission (hour), ac.surg: time to surgery (accident-surgery), ad.surg: post-admission time or admission-surgery time (h), surg-d: surgery time (h), ost: location of bone fractures, cb.inj: combined injuries (0,1,2) pri.am: primary amputation (0,1), myonec: number of necrotic muscle compartments in each patient (0,1,2,3,4) myoweak: number of marginally viable muscle compartments in each patient (0,1,2,3,4), myo: sum of myonec and myoweak (0,1,2,3,4).
pai$sex=as.factor(pai$sex)
pai$moi=as.factor(pai$moi)
pai$shock=as.factor(pai$shock)
pai$softi=as.factor(pai$softi)
pai$frac=as.factor(pai$frac)
pai$pai.loc=as.factor(pai$pai.loc)
pai$pai.type=as.factor(pai$pai.type)
pai$acs=as.factor(pai$acs)
pai$ali=as.factor(pai$ali)
pai$le.isc=as.factor(pai$le.isc)
pai$pri.am=as.factor(pai$pri.am)
pai$myonec=as.factor(pai$myonec)
pai$myoweak=as.factor(pai$myoweak)
pai$myo=as.factor(pai$myo)
t48$pri.am= as.factor(t48$pri.am)
table1(~ age+ sex+ moi+shock+ frac+ softi+ pai.loc+pai.type+ acs+ali | pri.am, data=pai)
| 0 (N=111) |
1 (N=11) |
Overall (N=122) |
|
|---|---|---|---|
| age | |||
| Mean (SD) | 33.4 (12.1) | 24.8 (6.68) | 32.7 (11.9) |
| Median [Min, Max] | 32.0 [15.0, 74.0] | 23.0 [15.0, 37.0] | 30.5 [15.0, 74.0] |
| sex | |||
| 0 | 22 (19.8%) | 0 (0%) | 22 (18.0%) |
| 1 | 89 (80.2%) | 11 (100%) | 100 (82.0%) |
| moi | |||
| 0 | 7 (6.3%) | 0 (0%) | 7 (5.7%) |
| 1 | 104 (93.7%) | 11 (100%) | 115 (94.3%) |
| shock | |||
| 0 | 89 (80.2%) | 9 (81.8%) | 98 (80.3%) |
| 1 | 22 (19.8%) | 2 (18.2%) | 24 (19.7%) |
| frac | |||
| 0 | 14 (12.6%) | 3 (27.3%) | 17 (13.9%) |
| 1 | 97 (87.4%) | 8 (72.7%) | 105 (86.1%) |
| softi | |||
| 0 | 91 (82.0%) | 6 (54.5%) | 97 (79.5%) |
| 1 | 20 (18.0%) | 5 (45.5%) | 25 (20.5%) |
| pai.loc | |||
| 0 | 15 (13.5%) | 2 (18.2%) | 17 (13.9%) |
| 1 | 96 (86.5%) | 9 (81.8%) | 105 (86.1%) |
| pai.type | |||
| 1 | 80 (72.1%) | 4 (36.4%) | 84 (68.9%) |
| 2 | 2 (1.8%) | 0 (0%) | 2 (1.6%) |
| 3 | 29 (26.1%) | 7 (63.6%) | 36 (29.5%) |
| acs | |||
| 0 | 75 (67.6%) | 4 (36.4%) | 79 (64.8%) |
| 1 | 36 (32.4%) | 7 (63.6%) | 43 (35.2%) |
| ali | |||
| 0 | 95 (85.6%) | 2 (18.2%) | 97 (79.5%) |
| 1 | 16 (14.4%) | 9 (81.8%) | 25 (20.5%) |
table1(~ pre.ad + ad.surg + ac.surg + surg.d| pri.am, data=pai)
| 0 (N=111) |
1 (N=11) |
Overall (N=122) |
|
|---|---|---|---|
| pre.ad | |||
| Mean (SD) | 10.8 (9.48) | 23.8 (24.0) | 12.0 (12.0) |
| Median [Min, Max] | 7.50 [0.500, 50.0] | 15.0 [3.00, 69.5] | 7.75 [0.500, 69.5] |
| ad.surg | |||
| Mean (SD) | 3.28 (1.45) | 3.45 (0.986) | 3.30 (1.42) |
| Median [Min, Max] | 3.00 [1.00, 9.00] | 3.50 [2.00, 5.00] | 3.00 [1.00, 9.00] |
| ac.surg | |||
| Mean (SD) | 14.0 (9.77) | 27.2 (24.4) | 15.2 (12.3) |
| Median [Min, Max] | 10.5 [3.00, 55.0] | 20.0 [6.50, 74.0] | 10.5 [3.00, 74.0] |
| surg.d | |||
| Mean (SD) | 3.43 (1.23) | 2.18 (0.560) | 3.32 (1.24) |
| Median [Min, Max] | 3.00 [1.00, 7.00] | 2.00 [1.50, 3.50] | 3.00 [1.00, 7.00] |
table1(~ pre.ad+ ad.surg+ ac.surg+ surg.d| ali, data=pai)
| 0 (N=97) |
1 (N=25) |
Overall (N=122) |
|
|---|---|---|---|
| pre.ad | |||
| Mean (SD) | 11.8 (10.6) | 12.8 (16.5) | 12.0 (12.0) |
| Median [Min, Max] | 8.00 [0.500, 50.0] | 7.00 [1.50, 69.5] | 7.75 [0.500, 69.5] |
| ad.surg | |||
| Mean (SD) | 3.34 (1.48) | 3.16 (1.18) | 3.30 (1.42) |
| Median [Min, Max] | 3.00 [1.00, 9.00] | 3.00 [1.00, 5.50] | 3.00 [1.00, 9.00] |
| ac.surg | |||
| Mean (SD) | 15.0 (10.9) | 16.0 (16.9) | 15.2 (12.3) |
| Median [Min, Max] | 11.0 [3.00, 55.0] | 9.50 [4.00, 74.0] | 10.5 [3.00, 74.0] |
| surg.d | |||
| Mean (SD) | 3.36 (1.20) | 3.18 (1.40) | 3.32 (1.24) |
| Median [Min, Max] | 3.00 [1.00, 7.00] | 3.00 [1.50, 7.00] | 3.00 [1.00, 7.00] |
table1 (~ myoweak+ myonec+ myo|pri.am, data=pai)
| 0 (N=111) |
1 (N=11) |
Overall (N=122) |
|
|---|---|---|---|
| myoweak | |||
| 0 | 72 (64.9%) | 9 (81.8%) | 81 (66.4%) |
| 1 | 23 (20.7%) | 2 (18.2%) | 25 (20.5%) |
| 2 | 7 (6.3%) | 0 (0%) | 7 (5.7%) |
| 3 | 1 (0.9%) | 0 (0%) | 1 (0.8%) |
| 4 | 8 (7.2%) | 0 (0%) | 8 (6.6%) |
| myonec | |||
| 0 | 83 (74.8%) | 0 (0%) | 83 (68.0%) |
| 1 | 19 (17.1%) | 0 (0%) | 19 (15.6%) |
| 2 | 8 (7.2%) | 0 (0%) | 8 (6.6%) |
| 3 | 1 (0.9%) | 4 (36.4%) | 5 (4.1%) |
| 4 | 0 (0%) | 7 (63.6%) | 7 (5.7%) |
| myo | |||
| 0 | 53 (47.7%) | 0 (0%) | 53 (43.4%) |
| 1 | 27 (24.3%) | 0 (0%) | 27 (22.1%) |
| 2 | 19 (17.1%) | 0 (0%) | 19 (15.6%) |
| 3 | 3 (2.7%) | 2 (18.2%) | 5 (4.1%) |
| 4 | 9 (8.1%) | 9 (81.8%) | 18 (14.8%) |
table1 (~ myoweak+ myonec+ myo|ali, data=pai)
| 0 (N=97) |
1 (N=25) |
Overall (N=122) |
|
|---|---|---|---|
| myoweak | |||
| 0 | 69 (71.1%) | 12 (48.0%) | 81 (66.4%) |
| 1 | 20 (20.6%) | 5 (20.0%) | 25 (20.5%) |
| 2 | 3 (3.1%) | 4 (16.0%) | 7 (5.7%) |
| 3 | 0 (0%) | 1 (4.0%) | 1 (0.8%) |
| 4 | 5 (5.2%) | 3 (12.0%) | 8 (6.6%) |
| myonec | |||
| 0 | 74 (76.3%) | 9 (36.0%) | 83 (68.0%) |
| 1 | 15 (15.5%) | 4 (16.0%) | 19 (15.6%) |
| 2 | 6 (6.2%) | 2 (8.0%) | 8 (6.6%) |
| 3 | 2 (2.1%) | 3 (12.0%) | 5 (4.1%) |
| 4 | 0 (0%) | 7 (28.0%) | 7 (5.7%) |
| myo | |||
| 0 | 53 (54.6%) | 0 (0%) | 53 (43.4%) |
| 1 | 22 (22.7%) | 5 (20.0%) | 27 (22.1%) |
| 2 | 15 (15.5%) | 4 (16.0%) | 19 (15.6%) |
| 3 | 1 (1.0%) | 4 (16.0%) | 5 (4.1%) |
| 4 | 6 (6.2%) | 12 (48.0%) | 18 (14.8%) |
table1(~ pre.ad+ ad.surg+ ac.surg+ surg.d| softi, data=pai)
| 0 (N=97) |
1 (N=25) |
Overall (N=122) |
|
|---|---|---|---|
| pre.ad | |||
| Mean (SD) | 12.1 (10.9) | 11.3 (15.7) | 12.0 (12.0) |
| Median [Min, Max] | 8.00 [0.500, 69.5] | 5.50 [1.50, 57.5] | 7.75 [0.500, 69.5] |
| ad.surg | |||
| Mean (SD) | 3.31 (1.45) | 3.24 (1.32) | 3.30 (1.42) |
| Median [Min, Max] | 3.00 [1.00, 9.00] | 3.00 [1.50, 7.00] | 3.00 [1.00, 9.00] |
| ac.surg | |||
| Mean (SD) | 15.4 (11.2) | 14.6 (16.0) | 15.2 (12.3) |
| Median [Min, Max] | 11.0 [3.00, 74.0] | 8.50 [4.00, 61.0] | 10.5 [3.00, 74.0] |
| surg.d | |||
| Mean (SD) | 3.30 (1.21) | 3.38 (1.39) | 3.32 (1.24) |
| Median [Min, Max] | 3.00 [1.00, 7.00] | 3.00 [2.00, 7.00] | 3.00 [1.00, 7.00] |
explore(pai,ost)
fracture= c("TPF","KJD","MLF","OF", "BIWF", "PIWF")
n= c(47, 35, 16, 7, 13, 4)
percent = c(38.5, 28.7,13.1, 5.7, 10.7, 3.3)
os=data.frame(fracture, n, percent)
os
## fracture n percent
## 1 TPF 47 38.5
## 2 KJD 35 28.7
## 3 MLF 16 13.1
## 4 OF 7 5.7
## 5 BIWF 13 10.7
## 6 PIWF 4 3.3
Explanation of the abbreviations related to the variable “ost” TPF: tibial plateau fractures, KJD: knee joint dislocation, MLF: multi-level fractures around the knee, OF: other fractures, BIWF: blunt injury without any fractures, PIWF: penetrating without any fractures. Comments: There was 80.3% (n=98) patients with fractures around the knee joint; Tibial plateau fracture and knee joint disclocation were highly associated with popliteal artery injury.
Desc(pai$cb.inj)
## ------------------------------------------------------------------------------
## pai$cb.inj (integer)
##
## length n NAs unique 0s mean meanCI'
## 122 122 0 3 107 0.20 0.10
## 100.0% 0.0% 87.7% 0.30
##
## .05 .10 .25 median .75 .90 .95
## 0.00 0.00 0.00 0.00 0.00 1.00 2.00
##
## range sd vcoef mad IQR skew kurt
## 2.00 0.56 2.82 0.00 0.00 2.64 5.45
##
##
## level freq perc cumfreq cumperc
## 1 0 107 87.7% 107 87.7%
## 2 1 6 4.9% 113 92.6%
## 3 2 9 7.4% 122 100.0%
##
## ' 95%-CI (classic)
Definition of values: 0: without combined injuries, 1: head trauma, 2: other injuries There was 12.3% combined injuries in other organs.
Desc(pai$pre.ad)
## ------------------------------------------------------------------------------
## pai$pre.ad (numeric)
##
## length n NAs unique 0s mean meanCI'
## 122 122 0 49 0 11.980 9.835
## 100.0% 0.0% 0.0% 14.124
##
## .05 .10 .25 median .75 .90 .95
## 3.000 3.550 5.000 7.750 14.375 24.950 35.650
##
## range sd vcoef mad IQR skew kurt
## 69.000 11.966 0.999 4.818 9.375 2.421 6.430
##
## lowest : 0.5, 1.0, 1.5, 2.5, 3.0 (5)
## highest: 48.0 (2), 49.0, 50.0, 57.5, 69.5
##
## ' 95%-CI (classic)
hist(pai$pre.ad, col="blue",border="white", main= "Distribution of time to admission", xlab="Time to admission")
Comments: time to admission was not a Normal distribution.
quantile(pai$pre.ad, c(0.025, 0.5, 0.975))
## 2.5% 50% 97.5%
## 2.5125 7.7500 48.9750
Bmean <- function(data,indices) {
d <- data[indices] # allows boot to select sample return(mean(d))
}
results= boot(data= pai$pre.ad, statistic= Bmean, R=1000)
results
##
## ORDINARY NONPARAMETRIC BOOTSTRAP
##
##
## Call:
## boot(data = pai$pre.ad, statistic = Bmean, R = 1000)
##
##
## Bootstrap Statistics :
## original bias std. error
## t1* 5.0 7.4290 12.78687
## t2* 5.5 6.5145 11.92765
## t3* 8.0 4.1090 12.25718
## t4* 3.5 8.9985 12.54594
## t5* 1.0 11.3030 12.70187
## t6* 8.5 3.6210 12.28193
## t7* 17.5 -5.7090 11.26062
## t8* 3.0 9.0390 12.13459
## t9* 19.0 -7.0040 11.47742
## t10* 4.0 7.4480 12.12490
## t11* 15.0 -3.1700 11.80885
## t12* 48.0 -35.5375 12.84671
## t13* 7.0 4.5550 11.10573
## t14* 5.0 7.1640 11.79664
## t15* 2.5 9.4125 12.46955
## t16* 3.5 7.7515 11.35292
## t17* 4.5 6.4570 11.03045
## t18* 8.5 3.8915 13.06029
## t19* 21.5 -9.8880 11.60030
## t20* 19.0 -6.7060 11.62589
## t21* 28.5 -17.6235 10.58237
## t22* 4.0 8.5140 12.63517
## t23* 12.0 0.1845 12.43937
## t24* 5.5 6.1190 11.72795
## t25* 5.0 6.0760 10.89334
## t26* 8.0 4.1225 12.25334
## t27* 24.0 -12.0565 12.39172
## t28* 8.5 3.9025 11.98317
## t29* 5.0 7.2295 12.71071
## t30* 8.0 4.3785 12.74888
## t31* 4.0 7.8650 12.38566
## t32* 6.0 5.7620 11.34130
## t33* 6.0 5.8350 11.76725
## t34* 5.5 6.9535 12.12919
## t35* 8.5 2.9025 11.63740
## t36* 9.0 2.4500 11.57102
## t37* 11.0 0.4545 11.46124
## t38* 50.0 -38.1355 12.41497
## t39* 9.0 2.6535 11.40334
## t40* 6.5 5.1405 11.52659
## t41* 15.0 -3.4975 11.48046
## t42* 20.0 -8.0230 12.31565
## t43* 6.5 4.5300 10.46387
## t44* 10.5 2.0505 12.53213
## t45* 3.0 8.6645 11.71441
## t46* 10.5 1.6790 11.89121
## t47* 6.0 5.7325 11.57370
## t48* 9.5 2.5330 12.17482
## t49* 57.5 -44.9730 12.34805
## t50* 3.0 8.8250 11.29965
## t51* 4.5 7.4865 11.79605
## t52* 8.0 3.8095 11.72339
## t53* 8.5 3.6100 12.06733
## t54* 25.0 -12.9205 12.05200
## t55* 3.5 7.6615 10.35881
## t56* 7.5 4.4575 11.77194
## t57* 19.5 -7.0915 12.69892
## t58* 19.5 -7.5730 11.70439
## t59* 29.0 -16.4995 12.93691
## t60* 11.5 0.3655 11.70586
## t61* 0.5 11.3225 11.77323
## t62* 11.5 0.3525 11.28669
## t63* 5.0 6.5340 11.70448
## t64* 13.5 -1.7850 11.55900
## t65* 4.5 7.7875 12.29991
## t66* 5.5 6.6260 12.18588
## t67* 29.0 -16.3045 12.82377
## t68* 3.0 8.7020 12.47968
## t69* 8.0 4.5095 13.13866
## t70* 10.0 1.9020 11.79657
## t71* 6.0 5.9225 11.40874
## t72* 49.0 -37.0375 12.16313
## t73* 36.0 -24.5285 11.70226
## t74* 6.0 5.4930 11.12264
## t75* 24.0 -11.9990 12.27368
## t76* 3.5 8.7930 12.46547
## t77* 7.5 4.0535 11.81198
## t78* 24.5 -12.5635 11.74601
## t79* 8.0 4.2400 12.04070
## t80* 3.0 9.5660 12.51894
## t81* 6.0 6.3310 12.64349
## t82* 5.5 6.2445 11.93083
## t83* 5.5 6.3540 11.31314
## t84* 6.0 6.2650 12.04059
## t85* 22.5 -10.4785 12.06977
## t86* 5.0 6.4230 11.21141
## t87* 26.0 -13.4385 12.83092
## t88* 14.0 -1.9860 12.19313
## t89* 8.0 4.1945 12.97618
## t90* 7.0 4.8050 11.78770
## t91* 5.0 6.5235 11.64774
## t92* 48.0 -36.5120 10.79279
## t93* 4.5 8.0800 12.07524
## t94* 69.5 -56.8510 12.86691
## t95* 4.5 6.9965 11.34202
## t96* 13.0 -1.0125 11.26714
## t97* 4.0 8.0540 11.43301
## t98* 5.0 7.1355 12.36595
## t99* 5.0 7.6440 12.68001
## t100* 6.5 5.7460 12.29185
## t101* 7.0 5.2305 12.45790
## t102* 7.0 5.0820 12.05492
## t103* 16.0 -3.4400 12.81523
## t104* 27.5 -15.4175 12.33867
## t105* 7.0 5.4820 12.90095
## t106* 5.5 6.2780 11.95212
## t107* 8.5 3.3915 11.58986
## t108* 1.5 10.6310 12.07566
## t109* 6.5 5.6995 12.41300
## t110* 16.0 -4.0470 12.09217
## t111* 6.5 4.9690 11.18643
## t112* 12.5 -0.5185 12.02208
## t113* 4.5 8.0385 12.52510
## t114* 10.0 2.6455 12.85904
## t115* 9.0 2.8445 11.32059
## t116* 6.5 5.3750 12.19950
## t117* 4.5 7.2115 11.28456
## t118* 10.0 1.9080 12.02513
## t119* 5.0 7.3145 12.31503
## t120* 16.0 -4.0340 11.49319
## t121* 20.0 -8.1060 12.10361
## t122* 14.5 -1.7995 12.13183
boot.ci( results, type=c("norm","basic","perc","bca"))
## Warning in norm.inter(t, adj.alpha): extreme order statistics used as endpoints
## BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
## Based on 1000 bootstrap replicates
##
## CALL :
## boot.ci(boot.out = results, type = c("norm", "basic", "perc",
## "bca"))
##
## Intervals :
## Level Normal Basic
## 95% (-27.491, 22.633 ) (-40.000, 8.500 )
##
## Level Percentile BCa
## 95% ( 1.5, 50.0 ) ( 0.5, 9.5 )
## Calculations and Intervals on Original Scale
## Warning : BCa Intervals used Extreme Quantiles
## Some BCa intervals may be unstable
set.seed(63839)
bmean1= two.boot(pai$pre.ad[pai$pri.am==1],pai$pre.ad[pai$pri.am==0], FUN=mean, R=1000)
bmean1$t0
## [1] 12.96192
boot.ci(bmean1)
## Warning in boot.ci(bmean1): bootstrap variances needed for studentized intervals
## BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
## Based on 1000 bootstrap replicates
##
## CALL :
## boot.ci(boot.out = bmean1)
##
## Intervals :
## Level Normal Basic
## 95% (-0.66, 26.38 ) (-1.53, 25.66 )
##
## Level Percentile BCa
## 95% ( 0.27, 27.45 ) ( 0.23, 27.16 )
## Calculations and Intervals on Original Scale
hist(bmean1, breaks=20, col="blue")
pai$toad[pai$pre.ad <6]<-"<6h"
pai$toad[pai$pre.ad >=6 & pai$pre.ad< 12]<-"6-12h"
pai$toad[pai$pre.ad >= 12 & pai$pre.ad< 24]<-"12-24h"
pai$toad[pai$pre.ad >= 24 & pai$pre.ad< 48]<-"24-48h"
pai$toad[pai$pre.ad >= 48]<- ">=48h"
Desc(pai$toad)
## ------------------------------------------------------------------------------
## pai$toad (character)
##
## length n NAs unique levels dupes
## 122 122 0 5 5 y
## 100.0% 0.0%
##
## level freq perc cumfreq cumperc
## 1 6-12h 45 36.9% 45 36.9%
## 2 <6h 41 33.6% 86 70.5%
## 3 12-24h 20 16.4% 106 86.9%
## 4 24-48h 10 8.2% 116 95.1%
## 5 >=48h 6 4.9% 122 100.0%
pai$group=factor(pai$toad, levels = c("<6h","6-12h","12-24h","24-48h",">=48h"))
t= table(pai$group)
t
##
## <6h 6-12h 12-24h 24-48h >=48h
## 41 45 20 10 6
barplot(t, ylim=c(0,70), col="blue", xlab = "Time to admission", ylab = "Number of patient", main = "Distribution of time to admission")
Desc(pai$ac.surg)
## ------------------------------------------------------------------------------
## pai$ac.surg (numeric)
##
## length n NAs unique 0s mean meanCI'
## 122 122 0 47 0 15.20 13.01
## 100.0% 0.0% 0.0% 17.40
##
## .05 .10 .25 median .75 .90 .95
## 6.00 6.50 8.00 10.50 18.75 29.85 39.60
##
## range sd vcoef mad IQR skew kurt
## 71.00 12.27 0.81 5.19 10.75 2.35 6.14
##
## lowest : 3.0, 4.0, 5.0, 5.5 (2), 6.0 (4)
## highest: 51.5, 53.5, 55.0, 61.0, 74.0
##
## ' 95%-CI (classic)
hist(pai$ac.surg, col="blue",border="white", main= "Distribution of time to surgery", xlab="Time to surgery")
### Comments: the plot shows that the mean time to surgery had not a Normal distribution.
quantile(pai$ac.surg, c(0.025, 0.5, 0.975))
## 2.5% 50% 97.5%
## 5.50 10.50 53.45
set.seed(63839)
bmean2= two.boot(pai$ac.surg[pai$pri.am==1],pai$ac.surg[pai$pri.am==0], FUN=mean, R=1000)
bmean2$t0
## [1] 13.21376
boot.ci(bmean2)
## Warning in boot.ci(bmean2): bootstrap variances needed for studentized intervals
## BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
## Based on 1000 bootstrap replicates
##
## CALL :
## boot.ci(boot.out = bmean2)
##
## Intervals :
## Level Normal Basic
## 95% (-0.65, 26.87 ) (-1.60, 26.07 )
##
## Level Percentile BCa
## 95% ( 0.35, 28.03 ) ( 0.32, 27.77 )
## Calculations and Intervals on Original Scale
hist(bmean2, breaks=20, col="blue")
pai$tosurg[pai$ac.surg <6]<-"<6h"
pai$tosurg[pai$ac.surg >=6 & pai$ac.surg< 12]<-"6-12h"
pai$tosurg[pai$ac.surg >= 12 & pai$ac.surg< 24]<-"12-24h"
pai$tosurg[pai$ac.surg >= 24 & pai$ac.surg< 48]<-"24-48h"
pai$tosurg[pai$ac.surg >= 48]<- ">=48h"
Desc(pai$tosurg)
## ------------------------------------------------------------------------------
## pai$tosurg (character)
##
## length n NAs unique levels dupes
## 122 122 0 5 5 y
## 100.0% 0.0%
##
## level freq perc cumfreq cumperc
## 1 6-12h 67 54.9% 67 54.9%
## 2 12-24h 31 25.4% 98 80.3%
## 3 24-48h 13 10.7% 111 91.0%
## 4 >=48h 6 4.9% 117 95.9%
## 5 <6h 5 4.1% 122 100.0%
pai$group=factor(pai$tosurg,levels= c("<6h","6-12h","12-24h","24-48h",">=48h"))
t= table(pai$group)
t
##
## <6h 6-12h 12-24h 24-48h >=48h
## 5 67 31 13 6
barplot(t, ylim=c(0,70), col="blue", xlab = "Time to surgery", ylab = "Number of patient", main = "Distribution of time to surgery")
pai$group=factor(pai$tosurg,levels= c("<6h","6-12h","12-24h","24-48h",">=48h"))
p= ggplot(data=pai, aes(x=group, fill=ac.surg))
p= p+geom_bar(aes(y=(..count..)/ sum(..count..)))
p= p+ xlab("Time to surgery group")+ ylab("Proportion")
p
bmean <- function(data,indices) {
d <- data[indices] # allows boot to select sample return(mean(d))
}
results= boot(data= pai$ac.surg, statistic= bmean, R=1000)
results
##
## ORDINARY NONPARAMETRIC BOOTSTRAP
##
##
## Call:
## boot(data = pai$ac.surg, statistic = bmean, R = 1000)
##
##
## Bootstrap Statistics :
## original bias std. error
## t1* 10.5 5.1510 12.90365
## t2* 11.0 3.9795 11.77387
## t3* 12.5 2.5785 12.17388
## t4* 10.5 4.1355 11.13986
## t5* 5.5 9.9350 12.62070
## t6* 13.0 2.2085 12.53768
## t7* 21.5 -6.4260 12.07055
## t8* 6.5 9.0260 12.87183
## t9* 23.5 -8.9045 11.32236
## t10* 6.5 9.0990 12.74110
## t11* 20.0 -5.0515 11.20373
## t12* 51.5 -36.3790 12.09240
## t13* 10.5 5.3310 13.49864
## t14* 7.5 7.4325 12.14688
## t15* 5.5 10.0280 12.24492
## t16* 9.5 5.3505 12.06804
## t17* 8.0 7.9965 13.05115
## t18* 10.5 4.4025 11.84758
## t19* 25.5 -10.5800 11.45123
## t20* 12.0 3.2495 12.34937
## t21* 32.0 -16.6500 12.19788
## t22* 9.0 6.0780 12.58031
## t23* 17.5 -2.0735 12.55880
## t24* 9.0 6.4050 12.09729
## t25* 6.5 8.4905 12.34001
## t26* 10.0 5.2985 12.42306
## t27* 30.0 -14.1715 13.25368
## t28* 11.5 4.0170 12.80970
## t29* 7.0 7.1165 10.97429
## t30* 13.5 1.5750 11.99330
## t31* 6.0 9.3110 12.03884
## t32* 8.0 6.8800 12.03027
## t33* 10.0 5.2295 12.35513
## t34* 7.0 8.3985 12.56604
## t35* 13.0 2.7960 12.98875
## t36* 14.0 1.0050 12.38292
## t37* 16.0 -0.7960 11.80615
## t38* 55.0 -39.7450 12.56252
## t39* 11.0 4.2555 12.50545
## t40* 9.5 6.2870 12.87890
## t41* 19.0 -3.7850 12.10412
## t42* 24.0 -8.9780 11.85899
## t43* 9.0 5.4585 11.09552
## t44* 13.0 2.6155 12.54657
## t45* 7.0 7.9490 12.10152
## t46* 13.0 2.8020 12.70253
## t47* 9.5 5.6160 12.27303
## t48* 12.0 3.1990 12.47644
## t49* 61.0 -45.6885 12.73161
## t50* 5.0 10.1805 11.97684
## t51* 8.0 7.4015 12.09865
## t52* 10.5 4.9640 12.54891
## t53* 10.5 4.7920 12.50098
## t54* 28.0 -13.0845 11.79013
## t55* 6.0 9.2535 12.27227
## t56* 10.0 5.1135 12.08679
## t57* 24.5 -10.2890 11.07111
## t58* 22.5 -7.4400 12.21180
## t59* 32.0 -16.9295 11.94408
## t60* 19.0 -3.9880 12.40991
## t61* 3.0 12.0320 11.76235
## t62* 15.5 -0.0815 12.49911
## t63* 9.0 6.3345 12.74450
## t64* 17.5 -1.7255 12.99695
## t65* 6.5 8.7060 11.93719
## t66* 7.0 8.9335 12.86144
## t67* 32.0 -16.3580 12.89834
## t68* 6.0 9.7340 13.03937
## t69* 11.5 3.7415 12.58417
## t70* 13.0 2.0275 12.65479
## t71* 10.5 4.6385 11.88052
## t72* 53.5 -38.1385 12.74938
## t73* 40.0 -24.6215 11.97938
## t74* 8.5 6.0105 11.34874
## t75* 28.0 -12.7555 12.05142
## t76* 6.5 8.9370 11.54662
## t77* 11.0 4.7085 12.67626
## t78* 28.5 -14.0110 10.92590
## t79* 11.0 3.8620 11.34540
## t80* 8.0 7.0840 12.07552
## t81* 8.5 7.1125 12.37854
## t82* 8.5 6.4200 11.67658
## t83* 8.0 7.4225 13.23094
## t84* 7.5 7.8155 12.41547
## t85* 23.5 -8.5720 12.24591
## t86* 7.0 7.9510 12.40058
## t87* 31.0 -15.4720 12.80745
## t88* 16.0 -0.7550 12.16291
## t89* 11.0 4.6980 12.00516
## t90* 8.5 6.8305 12.41179
## t91* 6.5 8.7305 12.28876
## t92* 49.5 -34.0005 12.16290
## t93* 7.5 7.3340 11.46263
## t94* 74.0 -58.3785 13.01099
## t95* 7.5 7.5955 12.32508
## t96* 20.0 -4.3320 12.90294
## t97* 7.5 8.2370 13.14007
## t98* 7.0 7.7810 12.06736
## t99* 7.0 8.0690 11.85007
## t100* 7.5 7.6030 11.32182
## t101* 9.5 6.1495 12.84998
## t102* 9.0 7.3330 13.83112
## t103* 18.0 -3.3095 11.43143
## t104* 30.5 -15.4340 12.00222
## t105* 9.0 6.4915 13.17556
## t106* 8.0 7.8520 12.88204
## t107* 11.0 4.7620 12.33357
## t108* 4.0 10.9240 11.82730
## t109* 9.5 5.5525 11.85916
## t110* 19.5 -4.2460 12.03509
## t111* 10.0 5.1690 12.39474
## t112* 15.5 -0.0580 12.46447
## t113* 6.5 8.6755 12.05084
## t114* 12.5 1.9490 11.25351
## t115* 11.0 3.9050 11.61343
## t116* 9.5 5.3610 11.49828
## t117* 8.5 6.7600 12.53639
## t118* 12.5 3.6230 13.36926
## t119* 6.0 9.1390 11.53609
## t120* 19.5 -4.3550 12.04627
## t121* 21.5 -6.1530 12.19653
## t122* 23.5 -7.9915 12.49038
boot.ci( results, type=c("norm","basic","perc","bca"))
## BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
## Based on 1000 bootstrap replicates
##
## CALL :
## boot.ci(boot.out = results, type = c("norm", "basic", "perc",
## "bca"))
##
## Intervals :
## Level Normal Basic
## 95% (-19.94, 30.64 ) (-34.00, 15.50 )
##
## Level Percentile BCa
## 95% ( 5.50, 55.00 ) ( 4.00, 50.31 )
## Calculations and Intervals on Original Scale
explore_all(fac)
ggpairs(fac)
Comments: there was no close correlation between predictive varibales for primary amputation, except “pre.ad” (time to admission) and “ac.surg” (time to surgery).
boxplot(pai$pre.ad, col="blue", main= "Distribution of time to admission", ylab=" time to admission (h)")
p= ggplot(pai, aes(x=pri.am, y=pre.ad, color=pri.am))
p1= p+ geom_boxplot(size=1, outlier.color = "black", outlier.size = 2)
p2= p1+ geom_jitter(alpha=0.5, width = 0.2)
p3= p2 + labs(x= "Primary amputation", y="Time to admission")
p4= p3 + ggtitle(" Association between Primary amputation and Time to admission")+ theme(plot.title = element_text(lineheight = 0.8,face = "bold", hjust= 0.5))
p5= p4 + theme(axis.title.x= element_text(color = "blue", size = 14, face="bold"), axis.title.y= element_text(color = "red", size = 14, face="bold"))
p5
p= ggplot(pai, aes(x=pri.am, y=ac.surg, color=pri.am))
p1= p+ geom_boxplot(size=1, outlier.color = "purple", outlier.size = 2)
p2= p1+ geom_jitter(alpha=0.5, width = 0.2)
p3= p2 + labs(x= "Primary amputation", y="Time to surgery")
p4= p3 + ggtitle(" Association between Primary amputation and Time to surgery") + theme(plot.title = element_text(lineheight = 0.8,face = "bold", hjust= 0.5))
p5= p4 + theme(axis.title.x= element_text(color = "blue", size = 14, face="bold"), axis.title.y= element_text(color = "red", size = 14, face="bold"))
p5
p= ggplot(t48, aes(x=pri.am, y=pre.ad, color=pri.am))
p1= p+ geom_boxplot(size=1, outlier.color = "black", outlier.size = 2)
p2= p1+ geom_jitter(alpha=0.5, width = 0.2)
p3= p2 + labs(x= "Primary amputation (0: no, 1:
yes)", y="Time to admission")
p4= p3 + ggtitle(" Association between Primary amputation and Time to admission < 48h")+ theme(plot.title = element_text(lineheight = 0.8,face = "bold", hjust= 0.5))
p5= p4 + theme(axis.title.x= element_text(color = "blue", size = 12, face="bold"), axis.title.y= element_text(color = "red", size = 14, face="bold"))
p5
p= ggplot(t48, aes(x=pri.am, y=ac.surg, color=pri.am))
p1= p+ geom_boxplot(size=1, outlier.color = "purple", outlier.size = 2)
p2= p1+ geom_jitter(alpha=0.5, width = 0.2)
p3= p2 + labs(x= "Primary amputation", y="Time to surgery")
p4= p3 + ggtitle(" Association between Primary amputation and Time to sugery
")+ theme(plot.title = element_text(lineheight = 0.8,face = "bold", hjust= 0.5))
p5= p4 + theme(axis.title.x= element_text(color = "blue", size = 12, face="bold"), axis.title.y= element_text(color = "red", size = 14, face="bold"))
p5
f1= glm(pri.am~ ali, family = binomial, data=pai)
logistic.display(f1)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## ali: 1 vs 0 26.72 (5.28,135.16) < 0.001 < 0.001
##
## Log-likelihood = -26.0778
## No. of observations = 122
## AIC value = 56.1556
f2= glm(pri.am~ pre.ad, family = binomial, data=pai)
logistic.display(f2)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## pre.ad (cont. var.) 1.06 (1.02,1.1) 0.004 0.004
##
## Log-likelihood = -32.9184
## No. of observations = 122
## AIC value = 69.8367
f3= glm(pri.am~ ac.surg, family = binomial, data=pai)
logistic.display(f3)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## ac.surg (cont. var.) 1.06 (1.02,1.1) 0.004 0.005
##
## Log-likelihood = -32.9282
## No. of observations = 122
## AIC value = 69.8563
f4= glm(pri.am~ age, family = binomial, data=pai)
logistic.display(f4)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## age (cont. var.) 0.91 (0.84,0.99) 0.028 0.009
##
## Log-likelihood = -33.5741
## No. of observations = 122
## AIC value = 71.1481
f5= glm(pri.am~ acs, family = binomial, data=pai)
logistic.display(f5)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## acs: 1 vs 0 3.65 (1,13.26) 0.05 0.044
##
## Log-likelihood = -34.9331
## No. of observations = 122
## AIC value = 73.8663
f6= glm(pri.am~ softi, family = binomial, data=pai)
logistic.display(f6)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## softi: 1 vs 0 3.79 (1.05,13.66) 0.042 0.049
##
## Log-likelihood = -35.0183
## No. of observations = 122
## AIC value = 74.0365
f7= glm(pri.am~ pai.type, family = binomial, data=pai)
logistic.display(f7)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## pai.type: ref.=1 0.043
## 2 0 (0,Inf) 0.994
## 3 4.83 (1.32,17.71) 0.018
##
## Log-likelihood = -33.815
## No. of observations = 122
## AIC value = 73.6301
f8= glm(pri.am~ pai.loc, family = binomial, data=pai)
logistic.display(f8)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## pai.loc: 1 vs 0 0.7 (0.14,3.57) 0.671 0.68
##
## Log-likelihood = -36.871
## No. of observations = 122
## AIC value = 77.7419
f9= glm(pri.am~ shock, family = binomial, data=pai)
logistic.display(f9)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## shock: 1 vs 0 0.9 (0.18,4.46) 0.896 0.895
##
## Log-likelihood = -36.9472
## No. of observations = 122
## AIC value = 77.8944
f10= glm(pri.am~ sex, family = binomial, data=pai)
logistic.display(f10)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## sex: 1 vs 0 14293671.02 (0,Inf) 0.991 0.032
##
## Log-likelihood = -34.6515
## No. of observations = 122
## AIC value = 73.3031
f11= glm(pri.am~ frac, family = binomial, data=pai)
logistic.display(f11)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## frac: 1 vs 0 0.38 (0.09,1.63) 0.194 0.221
##
## Log-likelihood = -36.2053
## No. of observations = 122
## AIC value = 76.4107
f12= glm(pri.am~ moi, family = binomial, data=pai)
logistic.display(f12)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## moi: 1 vs 0 4499932.06 (0,Inf) 0.992 0.243
##
## Log-likelihood = -36.2737
## No. of observations = 122
## AIC value = 76.5474
m= lrm(pri.am~ age+sex+shock+frac+pai.loc+ pai.type+acs+softi+ali+pre.ad, x=TRUE, y=TRUE,data=pai)
anova(m)
## Wald Statistics Response: pri.am
##
## Factor Chi-Square d.f. P
## age 2.68 1 0.1017
## sex 0.03 1 0.8538
## shock 0.51 1 0.4730
## frac 0.18 1 0.6734
## pai.loc 0.02 1 0.8816
## pai.type 0.71 2 0.7007
## acs 1.93 1 0.1649
## softi 0.78 1 0.3764
## ali 5.18 1 0.0228
## pre.ad 5.32 1 0.0210
## TOTAL 11.80 11 0.3790
plot(anova(m), pch=16,cex=1)
xvars= pai[,c("age","sex","shock","frac","pai.loc","pai.type","softi","acs","ali","pre.ad" )]
yvar= pai[, c("pri.am")]
s= bic.glm(xvars, yvar, strict=F, OR=20, glm.family="binomial", data=pai)
imageplot.bma(s)
summary(s)
##
## Call:
## bic.glm.data.frame(x = xvars, y = yvar, glm.family = "binomial", strict = F, OR = 20, data = pai)
##
##
## 18 models were selected
## Best 5 models (cumulative posterior probability = 0.6664 ):
##
## p!=0 EV SD model 1 model 2 model 3
## Intercept 100 -5.53965 592.68093 -5.50872 -2.77462 -6.07203
## age 45.1 -0.04661 0.06430 . -0.10421 .
## sex 8.1
## .1 1.29521 592.67757 . . .
## shock 7.6
## .1 0.06950 0.37678 . . .
## frac 5.0
## .1 -0.02406 0.27600 . . .
## pai.loc 5.7
## .1 -0.03978 0.29005 . . .
## pai.type 0.0
## .2 0.00000 0.00000 . . .
## .3 0.00000 0.00000 . . .
## softi 6.9
## .1 0.04528 0.28671 . . .
## acs 14.8
## .1 0.18848 0.57385 . . 1.25277
## ali 100.0
## .1 3.83207 1.15723 3.92885 3.90089 3.74268
## pre.ad 95.5 0.08823 0.04133 0.08614 0.10156 0.08262
##
## nVar 2 3 3
## BIC -528.57596 -528.45825 -526.02040
## post prob 0.258 0.243 0.072
## model 4 model 5
## Intercept -3.18763 -21.34976
## age -0.10273 .
## sex
## .1 . 16.14705
## shock
## .1 . .
## frac
## .1 . .
## pai.loc
## .1 . .
## pai.type
## .2 . .
## .3 . .
## softi
## .1 . .
## acs
## .1 1.13676 .
## ali
## .1 3.61972 3.60749
## pre.ad 0.09226 0.08776
##
## nVar 4 3
## BIC -525.25135 -525.08226
## post prob 0.049 0.045
Comments: The best model for primary amputation: log(odds)= alfa + beta1(ali)+ beta2(pre.ad)
m1=lrm(pri.am~ ali+ac.surg, data=pai)
m1
## Logistic Regression Model
##
## lrm(formula = pri.am ~ ali + ac.surg, data = pai)
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 122 LR chi2 30.78 R2 0.491 C 0.900
## 0 111 d.f. 2 g 1.918 Dxy 0.801
## 1 11 Pr(> chi2) <0.0001 gr 6.807 gamma 0.804
## max |deriv| 0.0003 gp 0.136 tau-a 0.133
## Brier 0.053
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept -5.7312 1.2943 -4.43 <0.0001
## ali=1 3.9101 1.0842 3.61 0.0003
## ac.surg 0.0835 0.0332 2.51 0.0120
##
An explanation for the above results: log(odds)= -5.73+ 3.91 (ali)+ 0.08 (pre.ad); With R2= 0.491, this model explains 49% of the difference of primary amputation risk and c= 0.900 equivalent to the acreage of receiver operating characteristic (ROC).
m2=glm(pri.am~ ali+ pre.ad, family = binomial, data=pai)
logistic.display(m2)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## crude OR(95%CI) adj. OR(95%CI) P(Wald's test)
## ali: 1 vs 0 26.72 (5.28,135.16) 50.85 (5.9,437.96) < 0.001
##
## pre.ad (cont. var.) 1.06 (1.02,1.1) 1.09 (1.02,1.17) 0.012
##
## P(LR-test)
## ali: 1 vs 0 < 0.001
##
## pre.ad (cont. var.) 0.003
##
## Log-likelihood = -21.5513
## No. of observations = 122
## AIC value = 49.1025
n= lrm(pri.am~ age+sex+shock+frac+pai.loc+ pai.type+acs+softi+ali+ac.surg, x=TRUE, y=TRUE,data=pai)
anova(n)
## Wald Statistics Response: pri.am
##
## Factor Chi-Square d.f. P
## age 2.66 1 0.1031
## sex 0.03 1 0.8590
## shock 0.47 1 0.4928
## frac 0.21 1 0.6484
## pai.loc 0.03 1 0.8534
## pai.type 0.73 2 0.6932
## acs 2.11 1 0.1467
## softi 0.79 1 0.3753
## ali 5.23 1 0.0222
## ac.surg 5.42 1 0.0199
## TOTAL 11.71 11 0.3859
plot(anova(n), pch=16,cex=1)
xvars1= pai[,c("age","sex","shock","frac","pai.loc","pai.type","softi","acs","ali","ac.surg" )]
yvar1= pai[, c("pri.am")]
s1= bic.glm(xvars1, yvar1, strict=F, OR=20, glm.family="binomial", data=pai)
imageplot.bma(s1)
summary(s1)
##
## Call:
## bic.glm.data.frame(x = xvars1, y = yvar1, glm.family = "binomial", strict = F, OR = 20, data = pai)
##
##
## 18 models were selected
## Best 5 models (cumulative posterior probability = 0.6688 ):
##
## p!=0 EV SD model 1 model 2 model 3
## Intercept 100 -5.78550 583.41560 -5.73129 -3.09679 -6.35555
## age 43.0 -0.04317 0.06199 . -0.10109 .
## sex 7.7
## .1 1.22237 583.41219 . . .
## shock 7.4
## .1 0.06528 0.36674 . . .
## frac 5.0
## .1 -0.02811 0.28319 . . .
## pai.loc 5.8
## .1 -0.04240 0.29603 . . .
## pai.type 0.0
## .2 0.00000 0.00000 . . .
## .3 0.00000 0.00000 . . .
## softi 6.9
## .1 0.04550 0.28886 . . .
## acs 16.2
## .1 0.21584 0.61410 . . 1.29437
## ali 100.0
## .1 3.81186 1.13752 3.91012 3.86868 3.76409
## ac.surg 95.3 0.08462 0.03971 0.08355 0.09729 0.08124
##
## nVar 2 3 3
## BIC -528.54678 -528.24914 -526.14872
## post prob 0.264 0.228 0.080
## model 4 model 5
## Intercept -3.54560 -21.47676
## age -0.10152 .
## sex
## .1 . 16.06961
## shock
## .1 . .
## frac
## .1 . .
## pai.loc
## .1 . .
## pai.type
## .2 . .
## .3 . .
## softi
## .1 . .
## acs
## .1 1.22492 .
## ali
## .1 3.62672 3.58279
## ac.surg 0.08994 0.08380
##
## nVar 4 3
## BIC -525.31894 -524.96869
## post prob 0.053 0.044
n1=lrm(pri.am~ ali+ac.surg, data=pai)
n1
## Logistic Regression Model
##
## lrm(formula = pri.am ~ ali + ac.surg, data = pai)
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 122 LR chi2 30.78 R2 0.491 C 0.900
## 0 111 d.f. 2 g 1.918 Dxy 0.801
## 1 11 Pr(> chi2) <0.0001 gr 6.807 gamma 0.804
## max |deriv| 0.0003 gp 0.136 tau-a 0.133
## Brier 0.053
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept -5.7312 1.2943 -4.43 <0.0001
## ali=1 3.9101 1.0842 3.61 0.0003
## ac.surg 0.0835 0.0332 2.51 0.0120
##
library(car)
## Warning: package 'car' was built under R version 4.1.2
## Loading required package: carData
##
## Attaching package: 'car'
## The following object is masked from 'package:boot':
##
## logit
## The following object is masked from 'package:DescTools':
##
## Recode
## The following objects are masked from 'package:rms':
##
## Predict, vif
## The following object is masked from 'package:dplyr':
##
## recode
vif(n1)
## Warning in vif.default(n1): No intercept: vifs may not be sensible.
## ali ac.surg
## 5.379931 3.838062
n2=glm(pri.am~ ali+ ac.surg, family = binomial, data=pai)
logistic.display(n2)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## crude OR(95%CI) adj. OR(95%CI) P(Wald's test)
## ali: 1 vs 0 26.72 (5.28,135.16) 49.9 (5.96,417.87) < 0.001
##
## ac.surg (cont. var.) 1.06 (1.02,1.1) 1.09 (1.02,1.16) 0.012
##
## P(LR-test)
## ali: 1 vs 0 < 0.001
##
## ac.surg (cont. var.) 0.003
##
## Log-likelihood = -21.5659
## No. of observations = 122
## AIC value = 49.1317
An explanation for the above results: log(odds)= -5.73+ 3.91 (ali)+ 0.08 (ac.surg); With R2= 0.491, this model explains 49% of the difference of primary amputation risk and c= 0.900 equivalent to the acreage of receiver operating characteristic (ROC).
pai$t6[pai$ac.surg<=6]<- "Under 6"
pai$t6[pai$ac.surg > 6]<- "Over 6"
time6= glm(pri.am~ t6, family = binomial, data=pai)
logistic.display(time6)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## t6 (cont. var.) 0 (0,Inf) 0.994 0.183
##
## Log-likelihood = -36.0707
## No. of observations = 122
## AIC value = 76.1415
pai$t12[pai$ac.surg<=12]<- "Under 12"
pai$t12[pai$ac.surg > 12]<- "Over 12"
time12= glm(pri.am~ t12, family = binomial, data=pai)
logistic.display(time12)
##
## Logistic regression predicting pri.am : 1 vs 0
##
## OR(95%CI) P(Wald's test) P(LR-test)
## t12 (cont. var.) 0.51 (0.15,1.77) 0.286 0.285
##
## Log-likelihood = -36.3852
## No. of observations = 122
## AIC value = 76.7705
isc$i6[isc$ac.surg < 6]<- "Under 6h"
isc$i6[isc$ac.surg>=6]<- "Over 6h"
is6= glm(pri.am~ i6, family = binomial, data=isc)
logistic.display(is6)
##
## Logistic regression predicting pri.am
##
## OR(95%CI) P(Wald's test) P(LR-test)
## i6 (cont. var.) 0 (0,Inf) 0.995 0.339
##
## Log-likelihood = -15.8775
## No. of observations = 25
## AIC value = 35.755
isc$i12[isc$ac.surg < 12]<- "Under 6h"
isc$i12[isc$ac.surg>=12]<- "Over 6h"
is12= glm(pri.am~ i12, family = binomial, data=isc)
logistic.display(is12)
##
## Logistic regression predicting pri.am
##
## OR(95%CI) P(Wald's test) P(LR-test)
## i12 (cont. var.) 0.29 (0.05,1.78) 0.18 0.175
##
## Log-likelihood = -15.4155
## No. of observations = 25
## AIC value = 34.831
soft$s6[soft$ac.surg<=6]<- "Under 6 "
soft$s6[soft$ac.surg>6]<- "Over 6 "
st6= glm(pri.am~ s6, family = binomial, data=soft)
logistic.display(st6)
##
## Logistic regression predicting pri.am
##
## OR(95%CI) P(Wald's test) P(LR-test)
## s6 (cont. var.) 0 (0,Inf) 0.995 0.112
##
## Log-likelihood = -11.2467
## No. of observations = 25
## AIC value = 26.4934
soft$s12[soft$ac.surg<=12]<- "Under 12 "
soft$s12[soft$ac.surg>12]<- "Over 12 "
st12= glm(pri.am~ s12, family = binomial, data=soft)
logistic.display(st12)
##
## Logistic regression predicting pri.am
##
## OR(95%CI) P(Wald's test) P(LR-test)
## s12 (cont. var.) 0.07 (0.01,0.75) 0.027 0.021
##
## Log-likelihood = -9.8667
## No. of observations = 25
## AIC value = 23.7334
soft$s12[soft$ac.surg<=12]<- "Under 12 "
soft$s12[soft$ac.surg>12]<- "Over 12 "
s12= lrm(pri.am~ s12, data=soft)
s12
## Logistic Regression Model
##
## lrm(formula = pri.am ~ s12, data = soft)
##
## Model Likelihood Discrimination Rank Discrim.
## Ratio Test Indexes Indexes
## Obs 25 LR chi2 5.29 R2 0.301 C 0.750
## 0 20 d.f. 1 g 0.868 Dxy 0.500
## 1 5 Pr(> chi2) 0.0215 gr 2.381 gamma 0.862
## max |deriv| 1e-07 gp 0.167 tau-a 0.167
## Brier 0.120
##
## Coef S.E. Wald Z Pr(>|Z|)
## Intercept 0.4055 0.9129 0.44 0.6569
## s12=Under 12 -2.6027 1.1785 -2.21 0.0272
##
exp(coef(s12))
## Intercept s12=Under 12
## 1.49999984 0.07407408
The following variables were used in this part: sec.am: secondary amputation, ost.ttt: orthopedic management, pvi: popliteal vein injury, pvi.ttt: management of popliteal vein injury, pai.len: length of injured popliteal artery (cm), pai.ttt: surgical treatment of injured popliteal artery, redo: revise a surgery to repair an anastomotic occlusion
Desc(frac$ost.ttt)
## ------------------------------------------------------------------------------
## frac$ost.ttt (character)
##
## length n NAs unique levels dupes
## 97 97 0 7 7 y
## 100.0% 0.0%
##
## level freq perc cumfreq cumperc
## 1 EF 68 70.1% 68 70.1%
## 2 DR, EF 15 15.5% 83 85.6%
## 3 splint 8 8.2% 91 93.8%
## 4 IF 2 2.1% 93 95.9%
## 5 IMN 2 2.1% 95 97.9%
## 6 DEB 1 1.0% 96 99.0%
## 7 DR, IMN 1 1.0% 97 100.0%
Desc(frac$first.aid)
## ------------------------------------------------------------------------------
## frac$first.aid (character)
##
## length n NAs unique levels dupes
## 97 97 0 3 3 y
## 100.0% 0.0%
##
## level freq perc cumfreq cumperc
## 1 splint 85 87.6% 85 87.6%
## 2 KDR 11 11.3% 96 99.0%
## 3 EF 1 1.0% 97 100.0%
Comments: There was 85.6% external fixation. (EF: external fixation, DR: disclocation reduction, IMN: intramedulary nail, IF: internal fixation, DEB: debridement)
Desc(sec$pvi)
## ------------------------------------------------------------------------------
## sec$pvi (integer)
##
## length n NAs unique 0s mean meanCI'
## 111 111 0 4 97 0.29 0.14
## 100.0% 0.0% 87.4% 0.44
##
## .05 .10 .25 median .75 .90 .95
## 0.00 0.00 0.00 0.00 0.00 2.00 2.00
##
## range sd vcoef mad IQR skew kurt
## 3.00 0.79 2.74 0.00 0.00 2.51 4.83
##
##
## level freq perc cumfreq cumperc
## 1 0 97 87.4% 97 87.4%
## 2 1 1 0.9% 98 88.3%
## 3 2 8 7.2% 106 95.5%
## 4 3 5 4.5% 111 100.0%
##
## ' 95%-CI (classic)
Desc(sec$piv.ttt)
## ------------------------------------------------------------------------------
## sec$piv.ttt (NULL)
##
## class is NULL, so there's nothing else to describe
Desc(sec$pai.len)
## ------------------------------------------------------------------------------
## sec$pai.len (numeric)
##
## length n NAs unique 0s mean meanCI'
## 111 111 0 12 0 2.63 2.23
## 100.0% 0.0% 0.0% 3.03
##
## .05 .10 .25 median .75 .90 .95
## 0.50 1.00 1.00 2.00 3.00 5.00 5.50
##
## range sd vcoef mad IQR skew kurt
## 14.50 2.13 0.81 1.48 2.00 2.47 9.87
##
##
## level freq perc cumfreq cumperc
## 1 0.5 11 9.9% 11 9.9%
## 2 1 22 19.8% 33 29.7%
## 3 1.5 10 9.0% 43 38.7%
## 4 2 20 18.0% 63 56.8%
## 5 2.5 4 3.6% 67 60.4%
## 6 3 17 15.3% 84 75.7%
## 7 4 9 8.1% 93 83.8%
## 8 5 12 10.8% 105 94.6%
## 9 6 3 2.7% 108 97.3%
## 10 9 1 0.9% 109 98.2%
## 11 10 1 0.9% 110 99.1%
## 12 15 1 0.9% 111 100.0%
##
## ' 95%-CI (classic)
Desc(sec$pai.ttt)
## ------------------------------------------------------------------------------
## sec$pai.ttt (integer - dichotomous)
##
## length n NAs unique
## 111 111 0 2
## 100.0% 0.0%
##
## freq perc lci.95 uci.95'
## 1 58 52.3% 43.0% 61.3%
## 2 53 47.7% 38.7% 57.0%
##
## ' 95%-CI (Wilson)
sec$pai.loc= as.factor(sec$pai.loc)
sec$pai.type=as.factor(sec$pai.type)
sec$pai.ttt=as.factor(sec$pai.ttt)
table1 (~ pai.loc + pai.type+ pai.len + pai.ttt|redo, data=sec)
## Warning in table1.formula(~pai.loc + pai.type + pai.len + pai.ttt | redo, :
## Terms to the right of '|' in formula 'x' define table columns and are expected
## to be factors with meaningful labels.
| 0 (N=104) |
1 (N=7) |
Overall (N=111) |
|
|---|---|---|---|
| pai.loc | |||
| 0 | 14 (13.5%) | 1 (14.3%) | 15 (13.5%) |
| 1 | 90 (86.5%) | 6 (85.7%) | 96 (86.5%) |
| pai.type | |||
| 1 | 77 (74.0%) | 3 (42.9%) | 80 (72.1%) |
| 2 | 2 (1.9%) | 0 (0%) | 2 (1.8%) |
| 3 | 25 (24.0%) | 4 (57.1%) | 29 (26.1%) |
| pai.len | |||
| Mean (SD) | 2.62 (2.17) | 2.71 (1.38) | 2.63 (2.13) |
| Median [Min, Max] | 2.00 [0.500, 15.0] | 2.00 [1.00, 5.00] | 2.00 [0.500, 15.0] |
| pai.ttt | |||
| 1 | 57 (54.8%) | 1 (14.3%) | 58 (52.3%) |
| 2 | 47 (45.2%) | 6 (85.7%) | 53 (47.7%) |
re= glm(redo~ pai.loc + pai.type + pai.len + pai.ttt, family = binomial, data=sec)
logistic.display(re)
##
## Logistic regression predicting redo
##
## crude OR(95%CI) adj. OR(95%CI) P(Wald's test)
## pai.loc: 1 vs 0 0.93 (0.1,8.34) 0.7 (0.06,8.84) 0.782
##
## pai.type: ref.=1
## 2 0 (0,Inf) 0 (0,Inf) 0.996
## 3 4.11 (0.86,19.61) 5.03 (0.95,26.73) 0.058
##
## pai.len (cont. var.) 1.02 (0.72,1.44) 0.64 (0.28,1.45) 0.283
##
## pai.ttt: 2 vs 1 7.28 (0.85,62.57) 22.89 (1.52,343.72) 0.023
##
## P(LR-test)
## pai.loc: 1 vs 0 0.787
##
## pai.type: ref.=1 0.154
## 2
## 3
##
## pai.len (cont. var.) 0.182
##
## pai.ttt: 2 vs 1 0.006
##
## Log-likelihood = -20.6866
## No. of observations = 111
## AIC value = 53.3731
Comment: Surgical bypass was significantly associated with occlusion, OR= 23.77, 95% CI: 1.56 to 362.47, p= 0.006
s= filter(pai, sec.am==1)
dim(s)
## [1] 2 84
s
## id age age.group sex hos.stay first.aid f.aid moi pre.ad over.6h shock MESS A
## 1 65 34 2 1 19 splint 0 1 4.5 0 0 8 3
## 2 80 17 1 1 48 splint 0 1 3.0 0 0 7 3
## B B. C D le.isc ali ost frac cb.inj co.inj CTA.d CTA ad.surg ac.surg
## 1 3 3 0 1 3 1 FF,KCF,TFF 1 0 0 1 1 1.5 6.5
## 2 3 3 0 0 3 1 TPF,FF 1 0 0 4 1 5.0 8.0
## surg.d orth acs fasc AC w.AC d.AC LC w.LC d.LC SPC w.SPC d.SPC DPC w.DPC
## 1 3.5 orth 1 1 1 1 0 1 1 0 0 0 1 2 0
## 2 5.5 orth 0 1 1 1 0 2 0 0 2 0 0 1 1
## d.DPC myonec myores myoweak myo softi ost.ttt pri.am sec.am t.am pai.loc
## 1 0 1 1 2 3 1 EF 0 1 1 0
## 2 0 0 1 2 2 1 EF 0 1 1 1
## pai.type pai.len pai.ttt pvi pvi.type pvi.ttt transf po.motor po.sens pulse24
## 1 3 1 1 0 0 0 2 RBC 0 0 0
## 2 3 4 2 0 0 0 4 RBC 0 0 0
## po.tem result myolytic AKI hyperkal reperf po.myores vas.com redo softi.inf
## 1 2 1 1 1 1 3 1 1 0 am
## 2 2 1 0 1 1 2 1 2 1 am
## HB0 HCT0 WBC0 fu.dus late.am le.dys toad group tosurg t6 t12
## 1 115 32.6 21.81 am am am <6h 6-12h 6-12h Over 6 Under 12
## 2 108 36.0 25.79 am am am <6h 6-12h 6-12h Over 6 Under 12
Comments: Secondary amputation rate was of 1.8% (n=2). One with severe soft tissue injury and extensive myonecrosis, was secondarily amputated because of severe postoperative reperfusion syndrome. This patient had later severe complications such as acute pancreatitis,acute renal failure and consequently spent nearly 3 week in the ICU. Another was secondarily amputated because of bypass occlusion, this patient was taken care of in the ICU for approximately 7 weeks with severe pneumonia, unstable hemodynamic pulmonary emboli, acute renal failure.
The following variables were used for analysis in this part: d-AC: dead anterior compartment (0,1), d-LC: dead lateral compartment (0,1), d-SPC: dead superficial posteroir compartment (0,1), d-DPC: dead deep posterior compartment (0,1), w-AC: marginally viable anterior compartment (0,1), w-LC: marginally viablelateral compartment (0,1), w-SPC: marginally viable superficial posteroir compartment (0,1), w-DPC: marginally viable deep posterior compartment
Estimating number of patients who were suitable for an early fasciotomy according to recommendation (preoperative time >6h, suspected acute compartment syndrome, severe soft tissue injury, acute limb ischemia, combined popliteal vein injury)
non.fasc= filter(pai,ac.surg<6 & acs==0 & softi==0 & ali==0 & pvi==0)
dim(non.fasc)
## [1] 1 84
non.fasc
## id age age.group sex hos.stay first.aid f.aid moi pre.ad over.6h shock MESS A
## 1 50 28 1 1 3 splint 0 1 3 0 0 5 2
## B B. C D le.isc ali ost frac cb.inj co.inj CTA.d CTA ad.surg ac.surg surg.d
## 1 2 2 0 0 1 0 KJD 1 2 1 0 0 2 5 4
## orth acs fasc AC w.AC d.AC LC w.LC d.LC SPC w.SPC d.SPC DPC w.DPC d.DPC
## 1 orth 0 1 2 0 0 2 0 0 2 0 0 2 0 0
## myonec myores myoweak myo softi ost.ttt pri.am sec.am t.am pai.loc pai.type
## 1 0 0 0 0 0 DR, EF 0 0 0 1 1
## pai.len pai.ttt pvi pvi.type pvi.ttt transf po.motor po.sens pulse24 po.tem
## 1 2 1 0 0 0 0 1 1 1 1
## result myolytic AKI hyperkal reperf po.myores vas.com redo softi.inf HB0 HCT0
## 1 4 0 1 0 1 0 0 0 0 149 41.5
## WBC0 fu.dus late.am le.dys toad group tosurg t6 t12
## 1 21.45 0 0 1 <6h <6h <6h Under 6 Under 12
Comments: According to the recommendation listed above, there was only one patient (0.82%) who did not meet the criteria for an early fasciotomy, whereas 121 pts (99,18%) were suitable for an early fasciotomy.
pai$n.myonec= ifelse(pai$myonec=="0",0,1)
pai$n.myoweak=ifelse(pai$myoweak=="0",0,1)
pai$n.myo=ifelse(pai$myo=="0",0,1)
head(pai)
## id age age.group sex hos.stay first.aid f.aid moi pre.ad over.6h shock MESS A
## 1 1 16 1 1 4 splint 0 1 5.0 1 0 6 2
## 2 2 20 1 1 7 splint 0 1 5.5 1 1 8 3
## 3 3 23 1 1 8 splint 0 1 8.0 1 0 8 2
## 4 4 42 2 1 14 splint 0 1 3.5 1 0 11 4
## 5 5 38 2 1 5 splint 0 1 1.0 0 0 5 2
## 6 6 40 2 1 5 splint 0 1 8.5 1 1 8 2
## B B. C D le.isc ali ost frac cb.inj co.inj CTA.d CTA ad.surg ac.surg surg.d
## 1 2 4 0 0 1 0 TPF 1 0 0 0.0 0 5.5 10.5 4.0
## 2 2 4 1 0 1 0 TPF 1 0 0 0.0 0 5.5 11.0 2.0
## 3 3 6 0 0 2 0 TPF 1 0 0 1.0 1 4.5 12.5 4.5
## 4 3 6 0 1 2 0 BW 0 0 0 0.0 0 7.0 10.5 2.0
## 5 2 2 0 1 1 0 KJD 1 0 0 3.0 1 4.5 5.5 2.5
## 6 2 4 1 1 1 0 TPF 1 0 0 2.5 1 4.5 13.0 3.0
## orth acs fasc AC w.AC d.AC LC w.LC d.LC SPC w.SPC d.SPC DPC w.DPC d.DPC
## 1 orth 0 1 0 0 1 0 0 1 2 0 0 2 0 0
## 2 orth 0 1 2 0 0 2 0 0 0 0 1 2 0 0
## 3 orth 1 1 2 0 0 2 0 0 2 0 0 2 0 0
## 4 orth 0 1 2 0 0 2 0 0 0 0 1 2 0 0
## 5 orth 1 1 2 0 0 2 0 0 2 0 0 1 1 0
## 6 orth 0 1 2 0 0 2 0 0 2 0 0 2 0 0
## myonec myores myoweak myo softi ost.ttt pri.am sec.am t.am pai.loc pai.type
## 1 2 1 0 2 0 EF 0 0 0 1 1
## 2 1 1 0 1 1 EF 0 0 0 1 1
## 3 0 0 0 0 0 EF 0 0 0 1 1
## 4 1 1 0 1 1 splint 0 0 0 1 1
## 5 0 0 1 1 0 DR, IMN 0 0 0 0 1
## 6 0 0 0 0 0 EF 0 0 0 1 1
## pai.len pai.ttt pvi pvi.type pvi.ttt transf po.motor po.sens pulse24 po.tem
## 1 5.0 2 0 0 0 0 1 1 1 1
## 2 3.0 2 0 0 0 0 1 1 1 1
## 3 2.0 1 1 1 1 2 RBC 1 1 1 1
## 4 1.5 1 0 0 0 0 1 1 1 1
## 5 5.0 2 0 0 0 0 1 1 1 1
## 6 3.0 2 0 0 0 0 1 1 1 1
## result myolytic AKI hyperkal reperf po.myores vas.com redo softi.inf HB0 HCT0
## 1 4 1 0 1 2 0 0 0 0 120 36.7
## 2 4 0 0 0 0 0 0 0 0 132 41.2
## 3 4 1 0 0 1 0 0 0 0 120 35.0
## 4 4 0 1 0 1 0 0 0 0 133 40.9
## 5 4 0 0 0 0 0 0 0 0 122 38.4
## 6 4 0 0 0 0 0 0 0 0 133 36.9
## WBC0 fu.dus late.am le.dys toad group tosurg t6 t12 n.myonec
## 1 8.90 0 0 2 <6h 6-12h 6-12h Over 6 Under 12 1
## 2 12.10 0 0 1 <6h 6-12h 6-12h Over 6 Under 12 1
## 3 10.30 0 0 1 6-12h 12-24h 12-24h Over 6 Over 12 0
## 4 12.61 0 0 1 <6h 6-12h 6-12h Over 6 Under 12 1
## 5 8.83 0 0 1 <6h <6h <6h Under 6 Under 12 0
## 6 17.18 0 0 1 6-12h 12-24h 12-24h Over 6 Over 12 0
## n.myoweak n.myo
## 1 0 1
## 2 0 1
## 3 0 0
## 4 0 1
## 5 1 1
## 6 0 0
nec= filter(pai, le.isc==1 & acs==0 & n.myonec>0)
dim(nec)
## [1] 11 87
necweak= filter(pai,le.isc==1 & acs==0 & n.myo>0)
dim(necweak)
## [1] 20 87
Comments: This analysis shows that there were 11 patients, who had not got any signs of acute limb ischemia and suspected acute compartment syndrome at the vascular exam in emergency department, had myonecrosis of at least one muscle compartment during surgical exploration. Similarly, there were 20 patients, who had not had any signs of acute limb ischemia and acute comparment syndrome, had myonecrosis or marginally viable muscle at least one compartment at fasciotomies.
stif= filter(pai,softi.inf==1)
dim(stif)
## [1] 2 87
inf= filter(stif,acs==0 & ali==0)
dim(inf)
## [1] 0 87
Comments: Nobody in this non-ischemic group had deep soft tissue infection during the postoperative period.
myonec.unique= filter(pai, myonec==1)
dim(myonec.unique)
## [1] 19 87
d.ac=filter(myonec.unique, d.AC==1)
dim(d.ac)
## [1] 11 87
d.lc= filter(myonec.unique, d.LC==1)
dim(d.lc)
## [1] 1 87
d.spc= filter(myonec.unique, d.SPC==1)
dim(d.spc)
## [1] 6 87
d.dpc= filter(myonec.unique, d.DPC==1)
dim(d.dpc)
## [1] 1 87
Test for signifcance with chi square test
myonec.unique= matrix(c(11,1,1,6), nrow = 4, byrow = T)
rownames(myonec.unique)=c("d.ac","d.lc","d.spc","d.dpc")
colnames(myonec.unique)= c("myonec.unique")
chisq.test(myonec.unique)
## Warning in chisq.test(myonec.unique): Chi-squared approximation may be incorrect
##
## Chi-squared test for given probabilities
##
## data: myonec.unique
## X-squared = 14.474, df = 3, p-value = 0.002326
Comments: In the patients who had a unique necrotic muscle compartment, the anterior compartment were mainly effected and these differences were statistically significant.
myoweak.unique= filter(pai,myoweak==1 & myonec==0)
dim(myoweak.unique)
## [1] 16 87
w.ac= filter(myoweak.unique,w.AC==1)
dim(w.ac)
## [1] 10 87
w.lc= filter(myoweak.unique,w.LC==1)
dim(w.lc)
## [1] 0 87
w.spc= filter(myoweak.unique,w.SPC==1)
dim(w.spc)
## [1] 5 87
w.dpc= filter(myoweak.unique,w.DPC==1)
dim(w.dpc)
## [1] 1 87
Test for significance with chi square test
myoweak.unique= matrix(c(10,0,5,1), nrow = 4, byrow = F)
rownames(myoweak.unique)=c("w.ac","w.lc","w.spc","w.dpc")
colnames(myoweak.unique)= c("myoweak.unique")
chisq.test(myoweak.unique)
## Warning in chisq.test(myoweak.unique): Chi-squared approximation may be
## incorrect
##
## Chi-squared test for given probabilities
##
## data: myoweak.unique
## X-squared = 15.5, df = 3, p-value = 0.001436
Comments: In the patients with a unique marginally viable muscle compartment and no myonecrosis in other compartments, the anterior compartment was also mainly effected and these differences were statistically significant.
t.ac= filter(pai, AC<2)
dim(t.ac)
## [1] 54 87
t.lc= filter(pai, LC<2)
dim(t.lc)
## [1] 34 87
t.spc= filter(pai,SPC<2)
dim(t.spc)
## [1] 34 87
t.dpc=filter(pai, DPC<2)
dim(t.dpc)
## [1] 29 87
Test for signifcance with chi square test
myo= matrix(c(54,34,34,29), nrow=4, byrow=T)
rownames(myo)= c("t.ac","t.lc","t.spc","t.dpc")
colnames(myo)= c("myo")
chisq.test(myo)
##
## Chi-squared test for given probabilities
##
## data: myo
## X-squared = 9.7682, df = 3, p-value = 0.02064
Comments: In general, for all of the necrotic and marginally viable muscle compartments, the anterior muscle compartment was the most vulnerable and these differences were statistically significant.
The following variables were used in this part: fu.dus: follow-up duplex ultrasound, late.am: late amputation, le.dys: limb dysfunction.
Desc(func$fu.dus)
## ------------------------------------------------------------------------------
## func$fu.dus (character - dichotomous)
##
## length n NAs unique
## 109 109 0 2
## 100.0% 0.0%
##
## freq perc lci.95 uci.95'
## 0 102 93.6% 87.3% 96.9%
## 1 7 6.4% 3.1% 12.7%
##
## ' 95%-CI (Wilson)
sec$fu.dus= as.factor(sec$fu.dus)
ste= glm(fu.dus~ pai.loc + pai.type + pai.len + pai.ttt, family = binomial, data=sec)
logistic.display(ste)
##
## Logistic regression predicting fu.dus : 1 vs 0
##
## crude OR(95%CI) adj. OR(95%CI) P(Wald's test)
## pai.loc: 1 vs 0 1.27 (0.15,10.97) 1.08 (0.11,10.71) 0.95
##
## pai.type: ref.=1
## 2 0 (0,Inf) 0 (0,Inf) 0.993
## 3 0.77 (0.15,3.95) 0.79 (0.15,4.1) 0.776
##
## pai.len (cont. var.) 0.98 (0.7,1.37) 0.87 (0.51,1.51) 0.626
##
## pai.ttt: 2 vs 1 1.41 (0.36,5.54) 1.86 (0.31,11.26) 0.5
##
## P(LR-test)
## pai.loc: 1 vs 0 0.95
##
## pai.type: ref.=1 0.824
## 2
## 3
##
## pai.len (cont. var.) 0.601
##
## pai.ttt: 2 vs 1 0.497
##
## Log-likelihood = -30.7651
## No. of observations = 111
## AIC value = 73.5302
Comments: No significant association between predictive vrariable and postoperative popliteal artery stenosis.
Desc (func$late.am)
## ------------------------------------------------------------------------------
## func$late.am (character - dichotomous)
##
## length n NAs unique
## 109 109 0 1
## 100.0% 0.0%
##
## freq perc lci.95 uci.95'
## 0 109 100.0% 96.6% 100.0%
##
## ' 95%-CI (Wilson)
Desc (func$le.dys)
## ------------------------------------------------------------------------------
## func$le.dys (character)
##
## length n NAs unique levels dupes
## 109 109 0 3 3 y
## 100.0% 0.0%
##
## level freq perc cumfreq cumperc
## 1 1 100 91.7% 100 91.7%
## 2 2 8 7.3% 108 99.1%
## 3 3 1 0.9% 109 100.0%