funscore: Score Proportion Data

Description Usage Arguments Examples

Description

This function will return a single data frame consisting of (1) the original sample data and (2) two categorical variables which record whether each sample data point is In Control or Extreme, relative to the two sets of alphas specified. These two categorical variables might be useful for additional analyses or coloring the funnel plot.

Usage

1
2
funscore(input, benchmark, alpha = 0.95, alpha2 = 0.998,
  method = "approximate")

Arguments

input

A data frame of your sample data, in the format outlined above.

benchmark

A number between 0 and 1 representing the benchmark (e.g. null) estimate for which confidence limits are calculated for. If not specified, the overall proportion of events is used.

alpha

A number between 0 and 1 representing the desired confidence limit (e.g. 0.95)

alpha2

A number between 0 and 1 representing the desired confidence limit (e.g. 0.998)

method

Choose between approximate or exact binomial control limits.

Examples

1
2
3
4
5
6
7
8
#My sample data
my_data  <- data.frame(id=c('A','B','C','D','E'), n=c(2,5,10,15,18), d=c(20,20,20,20,20))

#Score sample data
my_scoredata <- funscore(my_data, alpha=0.95, alpha2=0.998, method='approximate')

#View scored data
head(my_scoredata)

Example output

  id  n  d    r        z      score     score2
1  A  2 20 0.10 3.577709    Extreme    Extreme
2  B  5 20 0.25 2.236068    Extreme In Control
3  C 10 20 0.50 0.000000 In Control In Control
4  D 15 20 0.75 2.236068    Extreme In Control
5  E 18 20 0.90 3.577709    Extreme    Extreme

funnelR documentation built on May 2, 2019, 2:45 a.m.