Create contingency table and run disproportionality analysis

faers_phv_table(.object, ..., .full, .object2)

# S4 method for class 'FAERSascii,FAERSascii,missing'
faers_phv_table(.object, .events = "soc_name", ..., .full, .object2)

# S4 method for class 'FAERSascii,missing,FAERSascii'
faers_phv_table(.object, .events = "soc_name", ..., .full, .object2)

faers_phv_signal(.object, ...)

# S4 method for class 'FAERSascii'
faers_phv_signal(
  .object,
  .methods = NULL,
  ...,
  .phv_signal_params = list(),
  BPPARAM = SerialParam()
)

Arguments

.object

A FAERSascii object. The unique number of primaryids from .object will be regarded as n1..

...

Other arguments passed to specific methods.

  • faers_phv_table: other arguments passed to faers_counts.

  • faers_phv_signal: other arguments passed to faers_phv_table.

.full

A FAERSascii object with data from full data. In this way, .object must be a subset of .full. The unique number of primaryids from .full will be regarded as n.

.object2

A FAERSascii object with data from another interested drug, In this way, .object and .object2 should not be overlapped. The unique number of primaryids from object2 will be regarded as n0..

.events

A character specify the events column(s) in the .field data to count the unique primaryid. If multiple columns were selected, the combination for all columns will define the interested events.

.methods

Just an alias of method in phv_signal.

.phv_signal_params

Other arguments passed to phv_signal.

BPPARAM

An optional BiocParallelParam instance defining the parallel back-end to be used during evaluation.

Value

A data.table object.

Details

  • faers_phv_table: build a contingency table for all events in .events.

  • faers_phv_signal: Pharmacovigilance Analysis used contingency table constructed with faers_phv_table. You must pass .full or .object2 into faers_phv_table.

See also

Examples

# you must change `dir`, as the files included in the package are sampled
data <- faers(c(2004, 2017), c("q1", "q2"),
    dir = system.file("extdata", package = "faers"),
    compress_dir = tempdir()
)
#> Finding 2 files already downloaded: aers_ascii_2004q1.zip and
#> faers_ascii_2017q2.zip
#> → Combining all 2 <FAERS> Datas
if (FALSE) { # \dontrun{
# you must standardize and deduplication before disproportionality analysis
# you should replace `meddra_path` with yours
data <- faers_standardize(data, meddra_path)
data <- faers_dedup(data)
# we use faers_filter() to extract data we are interested
# here, we just sample 100 reports. You should do it based on your purpose.
faers_phv_signal(
    faers_filter(data, .fn = ~ sample(faers_primaryid(.x), 100L)),
    .full = data
)
} # }