-
Notifications
You must be signed in to change notification settings - Fork 0
/
funnel-test.R
29 lines (26 loc) · 875 Bytes
/
funnel-test.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
####################################################
# Local test
####################################################
# New York data using new function
load("data/cabg.rda")
x <- cabg
N<- x$Cases
R<- N-x$Deaths
P = N -x$EMR*N/100
xlabel<-"Number of operations per hospital"
xlabel<-"Number of operations per hospital (adjusted)"
xrange<-c(0,max(N))
# ylabel<-"Mortality rate (%)"
#yrange<-c(0,max( R/N ))
yrange<-c(min(R/N )-0.01, 1)
#yrange=c(0,1)
names= as.character(x$Hospital)
tails=c(0.001,0.025)
title<-"NY Cardiac Surgery - not risk-adjusted"
ylabel<-"Survival rate (%)"
funnel4(obs.prop=R/N, denom=N, pred.prop=P/N, names=names,
plot="funnel", rank="precision", riskadj=F, RASRplot=F,
plot.target=F, title=title,xrange=xrange,
yrange=yrange, tails=tails,xlab=xlabel,ylab=ylabel,ypercent=T,
bandcols=c("white","cyan","cyan3")
) #