Description Usage Arguments Value See Also
simulateSRS
simulates a spontaneous reporting (SR) data set. The relationships between
the drugs and the adverse events (AEs) are specified by a directed acyclic graph (DAG),
see generateDAG
.
Each report to a SRS contains two lists:
the drugs to which the patient was (thought to be) exposed to, and
the AEs that the patient experienced.
We will represent each report as a binary vector. The first items represent whether
the patient was exposed to the drug (1
if he/she was, and 0
otherwise).
The second part represents whether the patient experienced the event or not
(1
if he/she did, and 0
otherwise). For example, if there are 3 drugs and
4 events in total, a typical report could be
0 1 0 1 1 0 0
which represents that the patient was exposed to drug 2 (but not to drug 1 and 3), and
experienced event 1 and 2 (but not 3 and 4). The simulation results in a binary matrix
where each row is a report.
Valid Reports Not any binary sequence is a valid report. Each report
should contain at least one drug and at least one event (otherwise it would
never been sent to the spontaneous reporitng sytem).
While generating reports, we make sure that this is indeed the case. When one does not
want to check the validity and wants to allow any binary sequence, one can set
valid_reports
to FALSE
.
1 2 3 4 | simulateSRS(n_reports = 100, n_drugs = 10, n_events = 10,
alpha_drugs = 1, beta_drugs = 20, alpha_events = 1, beta_events = 20,
n_innocent_bystanders = 5, bystander_prob = 0.9, n_correlated_pairs = 2,
theta = 2, valid_reports = TRUE, seed = NULL, verbose = TRUE)
|
n_reports |
Number of reports (Default: 100) |
n_drugs |
Number of drugs (Default: 10) |
n_events |
Number of adverse drug events (Default: 10) |
alpha_drugs |
Alpha parameter for the drug marginal probabilities (Default: 1.0) |
beta_drugs |
Beta parameter for the drug marginal probabilities (Default: 20.0) |
alpha_events |
Alpha parameter for the event marginal probabilities (Default: 1.0) |
beta_events |
Beta parameter for the event marginal probabilities (Default: 20.0) |
n_innocent_bystanders |
Number of innocent bystanders (Default: 5) |
bystander_prob |
The conditional probability of the innocent bystander being one when the drug that is actually causing the AE is equal to 1. This parameter corresponds to γ in the paper (Default: .9) |
n_correlated_pairs |
Number of drug-AE pairs that are associated (Default: 2) |
theta |
Increase in odds-ratio when there is an edge going from a drug to an AE (Default: 2.0).
In case theta is a vector of length two, the odds ratio is drawn from a truncated
Normal distribution with mean |
valid_reports |
If |
seed |
The seed used by the RNG (Default: automatically set) |
verbose |
Verbosity (Default: |
sr |
A binary data frame with the simulated reports. The columns are
named |
dag |
The directed acycled graph as an |
nodes |
A tibble with all the information on each node/variate:
|
prob_drugs |
A vector with marginal probabilities of the drugs |
prob_events |
A vector with marginal probabilities of the events |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.