% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/linpred_draws_metad.R
\name{linpred_draws_metad}
\alias{linpred_draws_metad}
\alias{add_linpred_draws_metad}
\alias{linpred_rvars_metad}
\alias{add_linpred_rvars_metad}
\title{Obtain posterior draws of meta-d' model parameters}
\usage{
linpred_draws_metad(object, newdata, ..., pivot_longer = FALSE)

add_linpred_draws_metad(newdata, object, ..., pivot_longer = FALSE)

linpred_rvars_metad(object, newdata, ..., pivot_longer = FALSE)

add_linpred_rvars_metad(newdata, object, ..., pivot_longer = FALSE)
}
\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_linpred_draws]{tidybayes::add_linpred_draws} or
\link[tidybayes:add_linpred_rvars]{tidybayes::add_linpred_rvars}}

\item{pivot_longer}{Return the draws in long format?
\itemize{
\item if \code{TRUE}, resulting data frame has one row per posterior draw per model parameter
\item if \code{FALSE} (default), resulting data frame has one row per posterior draw
}}
}
\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{linpred_draws_metad}, identifiers for the posterior sample
\item \code{.variable}, \code{.value}: if \code{pivot_longer=TRUE}, \code{.variable} identifies different meta-d' model parameters and \code{.value} stores posterior samples
\item \code{M}, \code{dprime}, \code{c}, \code{meta_dprime}, \code{meta_c}, \verb{meta_c2_0_<k>}, \verb{meta_c2_1_<k>}: if \code{pivot_longer=FALSE}, posterior samples of all meta-d' model parameters
}
}
\description{
Given a data frame and a meta-d' model, adds estimates of all
model parameters. For \code{linpred_draws_metad} and \code{add_linpred_draws_metad}, parameters are
returned in a tidy tibble with one row per posterior draw. For
\code{linpred_rvars_metad} and \code{add_linpred_rvars_metad}, parameters are returned as
\link[posterior:rvar]{posterior::rvar}s, with one row per row in \code{newdata}.
}
\examples{
\donttest{
newdata <- tidyr::tibble(.row = 1)

# obtain model parameters (wide format)
# equivalent to `add_linpred_draws_metad(newdata, example_model())`
linpred_draws_metad(example_model(), newdata)

# obtain model parameters (long format)
# equivalent to `add_linpred_draws_metad(newdata, example_model(), pivot_longer = TRUE)`
linpred_draws_metad(example_model(), newdata, pivot_longer = TRUE)

# obtain model parameters (wide format, posterior::rvar)
# equivalent to `add_linpred_rvars_metad(newdata, example_model())`
linpred_rvars_metad(example_model(), newdata)

# obtain model parameters (long format, posterior::rvar)
# equivalent to `add_linpred_rvars_metad(newdata, example_model(), pivot_longer = TRUE)`
linpred_rvars_metad(example_model(), newdata, pivot_longer = TRUE)
}
}
\seealso{
\code{\link[tidybayes:linpred_draws]{tidybayes::linpred_draws()}}, \code{\link[tidybayes:linpred_rvars]{tidybayes::linpred_rvars()}}
}
