% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/roc_draws.R
\name{roc1_draws}
\alias{roc1_draws}
\alias{add_roc1_draws}
\alias{roc1_rvars}
\alias{add_roc1_rvars}
\title{Obtain posterior draws of the pseudo type 1 receiver operating characteristic (ROC) curve.}
\usage{
roc1_draws(object, newdata, ..., bounds = FALSE)

add_roc1_draws(newdata, object, ...)

roc1_rvars(object, newdata, ..., bounds = FALSE)

add_roc1_rvars(newdata, object, ...)
}
\arguments{
\item{object}{The \code{brms} model with the \code{metad} family}

\item{newdata}{A data frame from which to generate posterior predictions}

\item{...}{Additional parameters passed to \link[tidybayes:epred_draws]{tidybayes::epred_draws} or \link[tidybayes:epred_rvars]{tidybayes::epred_rvars}}

\item{bounds}{If \code{TRUE}, include the endpoints of the ROC at \eqn{(0, 0)} and \eqn{(1, 1)}.
Otherwise, the endpoints are excluded.}
}
\value{
a tibble containing posterior draws of the pseudo type 1 ROC with the following
columns:
\itemize{
\item \code{.row}: the row of \code{newdata}
\item \code{.chain}, \code{.iteration}, \code{.draw}: for \code{roc1_draws} and \code{add_roc1_draws}, identifiers for the posterior sample
\item \code{joint_response}: the combined type 1 / type 2 response (\eqn{J \in [1, 2K]}) for \eqn{K} confidence levels)
\item \code{response}: the type 1 response for perceived stimulus presence (\eqn{R \in \{0, 1\}})
\item \code{confidence}: the type 2 confidence response (\eqn{C \in [1, K]})
\item \code{p_fa}: the cumulative probability of a 'present'/'old' response for \code{stimulus==0} (\eqn{P(J \ge j \;\vert\; S=0)})
\item \code{p_hit}: the cumulative probability of a 'present'/'old' response for \code{stimulus==1} (\eqn{P(J \ge j \;\vert\; S=1)})
}
}
\description{
Given a data frame and a meta-d' model, adds estimates of the
cumulative probability over joint_responses.
For \code{roc1_draws} and \code{add_roc1_draws}, estimates are returned in a tidy
tibble with one row per posterior draw and per joint response.
For \code{roc1_rvars} and \code{add_roc1_rvars}, parameters are returned as
\link[posterior:rvar]{posterior::rvar}s, with one row per row in \code{newdata} and per joint response.
}
\examples{
\donttest{
newdata <- tidyr::tibble(.row = 1)

# compute pseudo-type 1 ROC curve
# equivalent to ``
roc1_draws(example_model(), newdata)
add_roc1_draws(newdata, example_model())

# use posterior::rvar for additional efficiency
# equivalent to `add_roc1_draws(newdata, example_model())`
roc1_rvars(example_model(), newdata)

# include the ROC bounds
# equivalent to `add_roc1_draws(newdata, example_model(), bounds = TRUE)`
roc1_draws(example_model(), newdata, bounds = TRUE)
}
}
\seealso{
\code{\link[tidybayes:epred_draws]{tidybayes::epred_draws()}}, \code{\link[tidybayes:epred_rvars]{tidybayes::epred_rvars()}}
}
