% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/prepare_data.R
\name{prepare_data}
\alias{prepare_data}
\title{Standardise user data for babebi}
\usage{
prepare_data(
  data,
  id,
  time,
  rater,
  outcome,
  time_order = NULL,
  rater_order = NULL
)
}
\arguments{
\item{data}{A data frame in long format.}

\item{id}{Unquoted column name identifying subjects or a character string.}

\item{time}{Unquoted column name identifying time points or a character string.}

\item{rater}{Unquoted column name identifying raters or a character string.}

\item{outcome}{Unquoted column name containing the observed score or a character string.}

\item{time_order}{Optional character vector of length 2 specifying the
order of the time factor (e.g., \code{c("pre", "post")}).}

\item{rater_order}{Optional character vector of length 2 specifying the
order of the rater factor (reference rater first).}
}
\value{
A data frame with four standardised columns: \code{id}, \code{time},
\code{rater}, and \code{y}.
}
\description{
Internal helper used to convert user-supplied data into the format
required by the estimation and Monte Carlo engine.
}
\details{
The function assumes a fully observed 2 (time) × 2 (rater) repeated-measures
design. Each subject must contribute exactly one observation for each
combination of time point and rater.

If \code{time_order} or \code{rater_order} are not provided, the ordering of factor
levels follows the order of appearance in the data. Users are encouraged
to specify these arguments explicitly when the ordering carries substantive
meaning (e.g., pre vs post).
}
\keyword{internal}
