% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/metad_family.R
\name{stanvars_metad}
\alias{stanvars_metad}
\title{Generate Stan code for the meta-d' model}
\usage{
stanvars_metad(
  K,
  distribution = "normal",
  metac_absolute = TRUE,
  categorical = FALSE,
  logit = TRUE
)
}
\arguments{
\item{K}{The number of confidence levels}

\item{distribution}{The noise distribution to use. Should be a parameter-free
distribution, i.e., one that is mean-centered without additional
variance/shape parameters. If the distribution is not already available in
stan, you must additionally provide two functions to Stan (one for
\verb{<distribution>_lcdf} and one for \verb{<distribution>_lccdf}).}

\item{metac_absolute}{Should the type 2 criterion (metac) be fixed to the
absolute type 1 criterion (c)? If \code{TRUE}, the model will set \code{metac = c}.
Otherwise, it will set \code{metac = M * c}, such that the type 2 criterion is
\emph{relatively} equal to the type 1 criterion (i.e., \code{meta_c/meta_dprime = c/dprime})}

\item{categorical}{If \code{FALSE} (default), use the multinomial likelihood over
aggregated data. If \code{TRUE}, use the categorical likelihood over individual
trials.}

\item{logit}{If \code{TRUE} (default), use the logit parameterization of the
likelihood over the log joint response probabilities. If \code{FALSE}, use the
standard parameterization of the likelihood over the actual joint response
probabilities. In most cases, the logit parameterization should provide
more stable numerical computations, but the standard parameterization might
be preferable in some settings.}
}
\value{
A \link[brms:stanvar]{brms::stanvar} object containing Stan code defining the
likelihood for the metad' model with \code{K} confidence levels, signal
distributed according to the distribution \code{distribution}, and where \code{metac = c} if \code{metac_absolute==TRUE}, and \code{metac = M*c} otherwise.
}
\description{
Generate Stan code for the meta-d' model
}
\examples{
# create stancode for the meta-d' model
# using the normal distribution and 3 levels of confidence
stanvars_metad(3)

# create stancode for the meta-d' model with meta_c = M * c
stanvars_metad(3, metac_absolute = FALSE)

# create stancode for the meta-d' model with
# an alternative distribution
# note: cumulative distribution functions must be defined
# in R and in Stan using [brms::stanvar()]
stanvars_metad(4, distribution = "gumbel_min")

}
