sim_Rs {pempi} | R Documentation |
Simulate data (R, R0, R1, R2, R3 and R4)
Description
Simulation function for random variables of interest.
Usage
sim_Rs(theta, pi0, n, alpha0 = 0, alpha = 0, beta = 0, seed = NULL, ...)
Arguments
theta |
A |
pi0 |
A |
n |
A |
alpha0 |
A |
alpha |
A |
beta |
A |
seed |
A |
... |
Additional arguments. |
Value
A cpreval_sim
object (list
) with the structure:
R: the number of participants in the survey sample that were tested positive.
R0: the number of participants in the survey sample that were tested positive with the first testing device (and are, thus, members of the sub-population).
R1: the number of participants in the survey sample that were tested positive with both (medical) testing devices (and are, thus, members of the sub-population).
R2: the number of participants in the survey sample that are tested positive only with the first testing device (and are, thus, members of the sub-population).
R3: the number of participants in the survey sample that are tested positive only with the second testing device.
R4: the number of participants that are tested negative with the second testing device (and are either members of the sub-population and have tested negative with the first testing device or are not members of the sub-population).
n: the sample size.
alpha: the False Negative (FN) rate for the sample R.
beta: the False Positive (FP) rate for the sample R.
alpha0: the alpha0 probability (as defined above).
...: additional arguments.
Author(s)
Stephane Guerrier
Examples
# Samples without measurement error
sim_Rs(theta = 3/100, pi0 = 1/100, n = 1500, seed = 18)
# With measurement error
sim_Rs(theta = 3/100, pi0 = 1/100, n = 1500, alpha0 = 0,
alpha = 0.01, beta = 0.05, seed = 18)