Skip to contents

Converts a result of qdm_calibrate to a data frame with one row: the chosen thresholds, the probabilities of meeting the criteria at these thresholds and the targets. The probabilities for all candidate thresholds are in the element curve of the result, which is a data frame.

Usage

# S3 method for class 'qdm_calibration'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Arguments

x

An object of class "qdm_calibration".

row.names

NULL (the default) or the name of the row.

optional

Not used.

...

Not used.

Value

A data frame with one row and the columns gamma_go, prob_go, target_go, gamma_nogo, prob_nogo and target_nogo (see qdm_calibrate).

Examples

des <- design_binary(
  n_t = 12, n_c = 12,
  prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5),
  criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1,
                                  gamma_go = 0.5, gamma_nogo = 0.8)
)
cal <- qdm_calibrate(des,
                     scenario_go = data.frame(pi_t = 0.4, pi_c = 0.4),
                     scenario_nogo = data.frame(pi_t = 0.7, pi_c = 0.4),
                     target_go = 0.05, target_nogo = 0.2)
as.data.frame(cal)
#>   gamma_go    prob_go target_go gamma_nogo prob_nogo target_nogo
#> 1     0.74 0.03368078      0.05       0.39 0.1820195         0.2