# Define scenarios (by description):
s1 <- riskyr(prev = .5, sens = .5, spec = .5, N = 10) # s1: define by 3 prob & N
s2 <- riskyr(hi = 2, mi = 3, fa = 2, cr = 3) # s2: same scenario by 4 freq
# Create data (from descriptions):
write_popu(s1) # data from (prob) description
write_popu(s2, # data from (freq) description & change labels:
cond_lbl = "Disease (X)",
cond_true_lbl = "sick", cond_false_lbl = "healthy",
dec_lbl = "Test (Y)")
# Rounding:
s3 <- riskyr(prev = 1/3, sens = 2/3, spec = 6/7, N = 10, round = FALSE) # s3: w/o rounding
write_popu(s3, cond_lbl = "X", dec_lbl = "Y", sdt_lbl = "class") # rounded to nearest integers
# Sampling:
s4 <- riskyr(prev = 1/3, sens = 2/3, spec = 6/7, N = 10, sample = TRUE) # s4: with sampling
write_popu(s4, cond_lbl = "X", dec_lbl = "Y", sdt_lbl = "class") # data from sampling
Run the code above in your browser using DataLab