benchmark_funnel: Benchmark funnel plot boundaries

Description Usage Arguments Value Examples

View source: R/benchmark_funnel.R

Description

This function produces data for drawing funnel plot boundaries that correspond to the 95% confidence intervals of a Poisson-gamma distribution corresponding to a desired systematic component of variation, the benchmark SCV.

Usage

1
benchmark_funnel(exp, scvtx = 3, alphax = 0.95)

Arguments

exp

expected values from indirect standardization (observed/expected)

scvtx

benchmark SCV , by default 3

alphax

alpha level, by default 95%

Value

exp

upperCI Upper limit O/E of benchmark Poisson-Gamma distribution

lowerCI Lower limit O/E of benchmark Poisson-Gamma distribution

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(nc.sids, package= "spData")

obs<-nc.sids$SID74

exp<-nc.sids$BIR74*sum(nc.sids$SID74)/sum(nc.sids$BIR74)

outlier<-outlier_stats(obs,exp,scvtx=3, alphax=.95)

funnel<-benchmark_funnel(exp,scvtx=3, alphax=.95)

library(ggplot2)
ggplot(funnel,aes(exp,upperCI))+
geom_line()+
geom_line(aes(y=lowerCI))+
geom_point(data=outlier$outlier_stats,aes(x=exp, y=obs/exp,color=is_outlier))+
xlab("Expected cases")+
ylab("Observed/Expected")+
labs(color="Outlier")+
theme_minimal()

guidopowell/scv documentation built on Nov. 4, 2019, 1:24 p.m.