% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predicted_draws_metad.R
\name{predicted_draws_metad}
\alias{predicted_draws_metad}
\alias{add_predicted_draws_metad}
\alias{predicted_rvars_metad}
\alias{add_predicted_rvars_metad}
\title{Obtain posterior predictions of joint responses}
\usage{
predicted_draws_metad(object, newdata, ...)

add_predicted_draws_metad(newdata, object, ...)

predicted_rvars_metad(object, newdata, ...)

add_predicted_rvars_metad(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 arguments passed to \link[tidybayes:add_predicted_draws]{tidybayes::add_predicted_draws} or
\link[tidybayes:add_predicted_rvars]{tidybayes::add_predicted_rvars}}
}
\value{
a tibble containing posterior draws of model parameters with the
following columns:
\itemize{
\item \code{.row}: the row of \code{newdata}
\item \code{.chain}, \code{.iteration}, \code{.draw}: for \code{predicted_draws_metad}, identifiers for the posterior sample
\item \code{stimulus}, \code{joint_response}, \code{response}, \code{confidence}: identifiers for the response type
\item \code{.prediction}: predicted type 1 and type 2 responses given the stimulus
}
}
\description{
Given a data frame and a meta-d' model, adds predictions of joint
type 1 and type 2 responses For \code{predicted_draws_metad} and
\code{add_predicted_draws_metad}, predictions are returned in a tidy tibble with one
row per posterior draw. For \code{predicted_rvars_metad} and
\code{add_predicted_rvars_metad}, parameters are returned as \link[posterior:rvar]{posterior::rvar}s,
with one row per row in \code{newdata}.
}
\examples{
\donttest{
newdata <- aggregate_metad(example_data())

# obtain model predictions
# equivalent to `add_predicted_draws_metad(newdata, example_model())`
predicted_draws_metad(example_model(), newdata)

# obtain model predictions (posterior::rvar)
# equivalent to `add_predicted_rvars_metad(newdata, example_model())`
predicted_rvars_metad(example_model(), newdata)
}
}
\seealso{
\code{\link[tidybayes:predicted_draws]{tidybayes::predicted_draws()}}, \code{\link[tidybayes:predicted_rvars]{tidybayes::predicted_rvars()}}
}
