% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate.R
\name{simulate_btl_efrm}
\alias{simulate_btl_efrm}
\title{Simulate paired-comparison EFRM data with differing frame units}
\usage{
simulate_btl_efrm(
  n_objects_per_set = 8,
  n_sets = 2,
  n_judges_per_panel = 6,
  n_panels = 2,
  reps_within = 20,
  reps_cross = 20,
  panel_units = NULL,
  set_units = NULL,
  set_origins = NULL,
  object_sd = 1,
  seed = NULL
)
}
\arguments{
\item{n_objects_per_set, n_sets}{Objects in each set and number of sets.}

\item{n_judges_per_panel, n_panels}{Judges in each panel and number of panels.}

\item{reps_within}{Replications of each within-set object pair.}

\item{reps_cross}{Replications of each cross-set object pair.}

\item{panel_units}{Panel units \code{phi} (length \code{n_panels}); the
default is all one, and any supplied vector is rescaled to geometric
mean one.}

\item{set_units}{Set units \code{alpha} (length \code{n_sets}); the default
is all one, and \code{alpha_1} is forced to one (the reference set).}

\item{set_origins}{Set origins \code{kappa} (length \code{n_sets}); the
default is all zero, and \code{kappa_1} is forced to zero.}

\item{object_sd}{Spread of the within-set calibration locations.}

\item{seed}{Optional RNG seed.}
}
\value{
A data frame of class \code{"rasch_sim"} with columns
  \code{object_a}, \code{object_b}, \code{winner}, \code{judge} and
  \code{panel}, and \code{attr(x, "truth")} holding the common-scale values
  \code{v}, the per-set \code{beta}, the units \code{phi}, \code{alpha},
  \code{kappa}, and the \code{object_sets} map to pass to
  \code{\link{btl_efrm}}.
}
\description{
Generates dichotomous paired comparisons whose latent unit differs across
judge-panel by object-set frames -- the paired-comparison extension of the
extended frame of reference model (Humphry 2005) fitted by
\code{\link{btl_efrm}}. Objects in set \code{s} have a within-set
calibration location \code{beta}; their common-scale value is
\code{v = alpha_s beta + kappa_s}. A comparison judged in panel \code{g}
carries the panel unit \code{phi_g}: within a set the comparison logit is
\code{phi_g (beta_a - beta_b)}, across sets it is \code{phi_g (v_a - v_b)}.
The planted panel units, set units and origins are recovered by
\code{\link{btl_efrm}}.
}
\examples{
d <- simulate_btl_efrm(6, 2, set_units = c(1, 1.4), seed = 1)
bt <- btl_efrm(d, "object_a", "object_b", winner = "winner",
               judge = "judge", panels = "panel",
               object_sets = attr(d, "truth")$object_sets)
bt$alpha_table   # recovers the ~1.4 set unit
}
