rawProcessing: rawProcessing

Description Usage Arguments Details Value References See Also Examples

View source: R/rawProcessing.R

Description

This rawProcessing function finds the actual (N_ij) and expected counts (E_ij) of each AE - drug pair by implementing the methodology described by DuMouchel (1999); This function outputs N and E in both matrix format and vector format.

Usage

1
2
3
4
5
6
7
8
rawProcessing(
  rawdata,
  stratify = FALSE,
  frequency_threshold,
  data.squashing = FALSE,
  zeroes = FALSE,
  keep_pts
)

Arguments

rawdata

A data frame containing columns named: primaryid, PT (Adverse Events), prod_ai (drug), strat1 (optional), strat2 (optional), ...... stratx

stratify

A logical scalar specifiying whether stratification is to be used (TRUE) or not (FALSE)

frequency_threshold

the minimum frequency of each AE or drug for it to be kept in the dataset

data.squashing

whether to conduct data squashing or not (TRUE or FALSE)

zeroes

A logical scalar specifying if zero counts should be included.

keep_pts

A vector of whole numbers for the number of points to leave unsquashed for each count (N). See the 'openEBGM' details section.

Details

An primaryid column must be included. Columns must be named as as primaryid, PT, prod_ai, strat1, strat2, ... stratx. Only variables containing 'strat' (case sensitive) will be used as stratification variables.

Value

a list including the following:

References

DuMouchel W (1999). "Bayesian Data Mining in Large Frequency Tables, With an Application to the FDA Spontaneous Reporting System." The American Statistician, 53(3), 177-190. openEBGM R - package

See Also

openEBGM

Examples

1
2
3
4
5
6
7
primaryid = c(1:10)
PT = c("fatigue", "restlessness", "sleepdisorder", "fatigue", "anaemia", "blood creatinine increased", "eosinophilia", "generalised oedema", "hypertension", "nephropathy toxic")
prod_ai = c("peginterferon alfa-2a", "peginterferon alfa-2a", "peginterferon alfa-2a", "pantoprazole", "ribavirin", "cyclosporine", "cyclosporine", "cyclosporine", "ribavirin", "flunitrazepam")
strat1 = c("M", "M", "M", "F", "F", "M", "M", "M", "F", "F")
strat2 = c("Young", "Young", "Young", "Old", "Old", "Old", "Old", "Young", "Young", "Young")
dat = data.frame(primaryid = primaryid, PT = PT, prod_ai = prod_ai, strat1 = strat1, strat2 = strat2)
result = hgzips::rawProcessing(dat, stratify = TRUE, frequency_threshold = 0, data.squashing = FALSE, zeroes = TRUE, keep_pts = 190000)

sidiwang/hgzips documentation built on Jan. 19, 2021, 4:09 p.m.