convertRawReports2Tables: Convert Reports to 2 x 2 Tables

Description Usage Arguments Details Value See Also

View source: R/convertRawReports2Tables.R

Description

Creates a data frame containing all 2 x 2 contingency tables given a raw spontaneous reporting (SR) data set. An SR data set is a binary matrix, where each row is a report. The first columns represent the presence (1) or absence of a drug (0), the other columns represent the presence or absence of an event.

The tables are organized as follows:

event j not event j total
drug i a c a + c
not drug i b d b + d
total a + b c + d n_reports

Usage

1
convertRawReports2Tables(reports, n_drugs, n_events)

Arguments

reports

A binary matrix. Each row is a report

n_drugs

The number of drugs

n_events

The number of events

Details

The code is a simplified version of the function create2x2Tables in the SRSim package.

Value

A data frame where each row represents a 2 x 2 table. The columns represent:

drug_id

The ID of the drug

event_id

The ID of the event

a

Number of times the drug and event appeared together in a report

b

Number of times the event appeared without the drug in a report

c

Number of times the drug appeared without the event in a report

d

Number of times the drug and event both did not appear in a report

See Also

convertRawReports2Tables


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