BCPNN: Bayesian Confidence Propagation Neural Network (BCPNN)

Description Usage Arguments Details Value References Examples

View source: R/BCPNN.R

Description

Applies the BCPNN to a collection of 2 x 2 tables of the form

event not event
drug a c
not drug b d

There are two versions of the BCPNN:

Usage

1
2
BCPNN(a, b, c, d, alpha = NULL, version = "original", mc_estimate = FALSE,
  mc_runs = 1000)

Arguments

a

A vector with the counts of the upper left corner of the tables

b

A vector with the counts of the lower left corner of the tables

c

A vector with the counts of the upper right corner of the tables

d

A vector with the counts of the lower right corner of the tables

alpha

Value between (0,1). If set, the lower endpoint the confidence (or credible) interval is returned. (Default = NULL)

version

Version of the BCPNN used. Can either be 'original' (Default) for the BCPNN as proposed orignally by Bate et al. (1998), or 'alternative' for the BCPNN as proposed by Norén et al. (2006).

mc_estimate

The value is estimated using Monte Carlo runs (Default = FALSE). Only used when version = 'alternative'.

mc_runs

The number of Monte Carlo runs used to estimate the credible interval. (Default: 1000). Only used when version = 'alternative'.

Details

The implementation of this function is based on the implementation in the PhViD package.

Value

The maximum aposteriori estimate of the information component (IC) or the lower endpoint of the approximate credible interval

References

Bate, A., Lindquist, M., Edwards, I. R., Olsson, S., Orre, R., Lansner, A., & De Freitas, R. M. (1998). A Bayesian neural network method for adverse drug reaction signal generation. European Journal of Clinical Pharmacology, 54(4), 315–321. http://doi.org/10.1007/s002280050466

Norén, G. N., Bate, A., Orre, R., & Edwards, I. R. (2006). Extending the methods used to screen the WHO drug safety database towards analysis of complex associations and improved accuracy for rare events. Statistics in Medicine, 25(21), 3740–3757. http://doi.org/10.1002/sim.2473

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# get the tables
a <- srdata$tables$a
b <- srdata$tables$b
c <- srdata$tables$c
d <- srdata$tables$d

# Applying the original BCPNN: 
BCPNN(a, b, c, d)
# [1]  0.349783103 -0.609077730 -0.168446711 -0.277981964 ...

# Getting the lower end point of the 95% confidence intervaL: 
BCPNN(a, b, c, d, alpha = 0.05) 
# [1]  0.280077253 -0.994960076 -0.293624528 -0.408661852 ...

# Using the alternative version: 
BCPNN(a, b, c, d, version = 'alternative')
# [1]  0.350235800 -0.595807902 -0.166901050 -0.276387348 ...

# Getting the lower end points of the 95% confidence interval 
# using the alternative version. The estimates are based on 
# 10,000 Monte Carlo samples:
BCPNN(a, b, c, d, version = 'alternative', 
      alpha = 0.05, mc_estimate = TRUE, mc_runs = 10^4)
# [1]  [1]  0.31621489 -0.92490130 -0.25601307 -0.37040303 ...

bips-hb/pvm documentation built on Dec. 14, 2020, 9:31 a.m.