% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/buzzEBMcatMcatY.R
\name{buzzEBMcatMcatY}
\alias{buzzEBMcatMcatY}
\title{Select binary mediators using the GT-exploratory Bayesian mediation model with dichotomous dependent variables.}
\usage{
buzzEBMcatMcatY(
  model,
  dataset,
  my_prior = NULL,
  advanced = NULL,
  a.pip.hyperalpha = NULL,
  a.pip.hyperbeta = NULL,
  b.pip.hyperalpha = NULL,
  b.pip.hyperbeta = NULL,
  direct.coef.mean = NULL,
  direct.coef.precision = NULL,
  direct.coef.init = NULL,
  a.pip.hyperprior.init = NULL,
  b.pip.hyperprior.init = NULL,
  n_chains = NULL,
  n_adapt = NULL,
  n_burnin = NULL,
  n_iter = NULL,
  thin = NULL
)
}
\arguments{
\item{model}{A character string specifying the mediation model to be
fitted. The model should be specified using the syntax
\code{"Y ~ X1 + X2 | M1 + M2"}, where \code{Y}, \code{X1},
\code{X2}, \code{M1}, and \code{M2} should be replaced by the names of the
corresponding variables in the dataset.}

\item{dataset}{A \code{data.frame} containing the variables specified in the model.}

\item{my_prior}{Optional \code{data.frame} containing custom prior specifications.
Run \code{parms <- run_parms_wizard()} to see the required structure.}

\item{advanced}{Character. Use \code{"interactive"} for an interactive wizard
to choose parameter distributions, or leave \code{NULL} for defaults.}

\item{a.pip.hyperalpha}{Numeric scalar or vector. Alpha hyperparameter of
the Beta prior distribution for the \eqn{a}-path inclusion probabilities.
The default value is 3.}

\item{a.pip.hyperbeta}{Numeric scalar or vector. Beta hyperparameter of
the Beta prior distribution for the \eqn{a}-path inclusion probabilities.
The default value is 3.}

\item{b.pip.hyperalpha}{Numeric scalar or vector. Alpha hyperparameter of
the Beta prior distribution for the \eqn{b}-path inclusion probabilities.
The default value is 3.}

\item{b.pip.hyperbeta}{Numeric scalar or vector. Beta hyperparameter of
the Beta prior distribution for the \eqn{b}-path inclusion probabilities.
The default value is 3.}

\item{direct.coef.mean}{Numeric scalar or vector. Mean parameter of the
Normal prior distribution for the direct effects (\eqn{c'}). The default
value is 0.}

\item{direct.coef.precision}{Numeric scalar or vector. Precision parameter
of the Normal prior distribution for the direct effects (\eqn{c'}). The
default value is 1.0E-6.}

\item{direct.coef.init}{Numeric or \code{NULL}. Initial value for the direct
effect (\eqn{c'}). Default is 0.}

\item{a.pip.hyperprior.init}{Numeric or \code{NULL}. Initial value of the
\eqn{a}-path inclusion probability (PIP). The default value is 0.5.}

\item{b.pip.hyperprior.init}{Numeric or \code{NULL}. Initial value of the
\eqn{b}-path inclusion probability (PIP). The default value is 0.5.}

\item{n_chains}{Integer. Number of MCMC chains.}

\item{n_adapt}{Integer. Number of adaptation iterations.}

\item{n_burnin}{Integer. Number of burn-in iterations.}

\item{n_iter}{Integer. Number of post-burn-in iterations.}

\item{thin}{Integer. Thinning interval.}
}
\value{
A matrix of posterior summary statistics for the monitored
parameters.
}
\description{
This function selects time-invariant binary mediators using the generalized
two-stage exploratory Bayesian mediation model with dichotomous dependent variables.
}
\details{
Fits a generalized two-stage exploratory Bayesian mediation model, specifically
designed for cases where both the mediators (\eqn{M}) and the outcome
variable (\eqn{Y}) are binary (0/1).
}
\note{
This function is strictly for binary data. For variables with more than
two levels, please convert them into dummy variables or ensure they
are binary before running.
}
\examples{
# Binary case: Both M and Y are Binary
set.seed(101)
n <- 100
toy_data <- data.frame(
   X = rbinom(n, 1, 0.5),
   M1 = rbinom(n, 1, 0.3),
   M2 = rbinom(n, 1, 0.7),
   Y = rbinom(n, 1, 0.5)
)

# Fit the model
results <- buzzEBMcatMcatY(
   model    = "Y ~ X | M1 + M2",
   dataset  = toy_data,
   n_burnin = 200,
   n_iter   = 1000
)

summary(results)

}
\references{
Shi, D., Shi, D., and Fairchild, A. J. (2023) "Variable Selection for Mediators
under a Bayesian Mediation Model" <doi:10.1080/10705511.2022.2164285>
}
