-
Notifications
You must be signed in to change notification settings - Fork 0
/
BraveDataRun 1.R
170 lines (123 loc) · 4.37 KB
/
BraveDataRun 1.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
library(ggplot2)
library(sciplot)
library(mosaic)
library(tableone)
library(survival)
library(car)
library(gridExtra)
brave=read.csv("BraveModWide.csv")
brave
#I'm going to create a data matrix
##(easyAndShould,DifficultAndNot,EasyAndNot,DifficultShould))
dmatrix <- matrix(c(18,6,35,0),ncol=2,byrow=TRUE,
dimnames = list(c("BRAVE Score < 5", "BRAVE Score + or >5"),
c("Easy Intubation Group", "Difficult Intubation Group")))
bargraph.CI(dmatrix)
grid.table(dmatrix)
fisher.test(dmatrix)
difficult= subset(brave, Grade >="3")
difficult
easy= subset(brave, Grade < "3")
easy
difficult$Grade
easy$Grade
count(difficult)
count(easy)
difficult$Total.Score
easy$Total.Score
easy$Laryngoscope.used
easy$Cricoid.Pressur
easy$Extreme.hockey.stick
easy$Extreme.neck.position
easy$Bougie
easy$Multiple.Attempts
easy$H.O.Sifficult.Airway
easy$Disease.associated.with
easy$Mallampati
easy$Thyromental.distance
easy$Mouth.Opening
easy$Neck.Mobility
easy$Neck.Circumference
easy$BMI.30
easy$BMI.40
easy$Thyro.sternal.distance
easy$Mandibular.angle
easy$Overbite
easy$Absence.of.Upper.Incisors
difficult$Laryngoscope.used
difficult$Cricoid.Pressur
difficult$Extreme.hockey.stick
difficult$Extreme.neck.position
difficult$Bougie
difficult$Multiple.Attempts
difficult$H.O.Sifficult.Airway
difficult$Disease.associated.with
difficult$Mallampati
difficult$Thyromental.distance
difficult$Mouth.Openingv
difficult$Neck.Mobility
difficult$Neck.Circumference
difficult$BMI.30
difficult$BMI.40
difficult$Thyro.sternal.distance
difficult$Mandibular.angle
difficult$Overbite
difficult$Absence.of.Upper.Incisors
count(easy$Total.Score >="5")
count(easy)
count(easy$Total.Score<"5")
amatrix <- matrix(c(50,1,3,5),ncol=2,byrow=TRUE,
dimnames = list(c("BRAVE Score < 5", "BRAVE Score ???5"),
c("Easy Intubation Group", "Difficult Intubation Group")))
grid.table(amatrix)
fisher.test(amatrix)
bmatrix <- matrix(c(45,2,8,4),ncol=2,byrow=TRUE,
dimnames = list(c("BRAVE Score < 5", "BRAVE Score ???5"),
c("Easy Intubation Group", "Difficult Intubation Group")))
grid.table(bmatrix)
fisher.test(bmatrix)
cmatrix <- matrix(c(51,2,2,4),ncol=2,byrow=TRUE,
dimnames = list(c("BRAVE Score < 5", "BRAVE Score ???5"),
c("Easy Intubation Group", "Difficult Intubation Group")))
grid.table(cmatrix)
fisher.test(cmatrix)
dmatrix <- matrix(c(50,6,3,0),ncol=2,byrow=TRUE,
dimnames = list(c("BRAVE Score < 5", "BRAVE Score ???5"),
c("Easy Intubation Group", "Difficult Intubation Group")))
grid.table(dmatrix)
fisher.test(dmatrix)
dmatrix <- matrix(c(18,6,35,0),ncol=2,byrow=TRUE,
dimnames = list(c("BRAVE Score < 5", "BRAVE Score ???5"),
c("Easy Intubation Group", "Difficult Intubation Group")))
grid.table(dmatrix)
fisher.test(dmatrix)
dmatrix <- matrix(c(18,6,35,0),ncol=2,byrow=TRUE,
dimnames = list(c("BRAVE Score < 5", "BRAVE Score ???5"),
c("Easy Intubation Group", "Difficult Intubation Group")))
grid.table(dmatrix)
fisher.test(dmatrix)
dmatrix <- matrix(c(18,6,35,0),ncol=2,byrow=TRUE,
dimnames = list(c("BRAVE Score < 5", "BRAVE Score ???5"),
c("Easy Intubation Group", "Difficult Intubation Group")))
grid.table(dmatrix)
fisher.test(dmatrix)
easyint=c("50,3")
diffint=c("1,5")
table(easyint,diffint)
N=c(rep(50,3),rep(20,3))
Proport=c(20,15,15,5,10,5)/N
data <- data.frame(
Category=rep(c('Smoker','Non-smoker'), each=3),
Label=c('0<x<5','5<x<10','10<x<15','0<x<5','5<x<10','10<x<15'),
Proportion=Proport,
SD=sqrt(Proport*(1-Proport)/N)
)
me1=qnorm(0.025,mean=data$Proportion,sd=data$SD)
me2=qnorm(0.975,mean=data$Proportion,sd=data$SD)
mat <- matrix(data$Proportion, nrow = 2, dimnames = list(levels(data$Category),levels(data$Label)))
barx=barplot(mat, beside=T, col = c("blue", "orange", "blue", "orange","blue", "orange"), names.arg = toupper(colnames(mat)), legend.text=TRUE,ylim=c(0,1),xlab="Income",ylab="Proportion",main="Bar plot with 95% confidence intervals")
box()
arrows(barx,me2, barx, me1, angle=90, code=1)
arrows(barx,me1, barx, me2, angle=90, code=1)
t.test(difficult$Total.Score,easy$Total.Score)
sample1=