convert2Tables: Create 2 x 2 Tables from DAG based SR data

Description Usage Arguments Value See Also Examples

View source: R/convert2Tables.R

Description

Creates a data frame with all 2 x 2 contigency tables given a simulated data set from simulateSRS. 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

Arguments

sr

The output generated by the simulateSRS function

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

prob_drug

The marginal probability of that drug

prob_event

The marginal probability of that event

or

The increase of the odds ratio when the drug is on the report

associated

TRUE is there is a non-zero correlation, FALSE otherwise

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

simulateSRS

Examples

1
2
sr <- simulateSRS()
tables <- create2x2Tables(sr)

bips-hb/srsim documentation built on Dec. 10, 2020, 3:16 p.m.