% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate.R
\name{simulate_efrm}
\alias{simulate_efrm}
\title{Simulate extended frame-of-reference data with differing units}
\usage{
simulate_efrm(
  n_per_group = 300,
  items_per_set = 8,
  n_sets = 2,
  n_groups = 2,
  set_unit_ratio = 1.3,
  group_unit_ratio = 1,
  theta_sd = 1.3,
  seed = NULL
)
}
\arguments{
\item{n_per_group}{Persons in each group.}

\item{items_per_set}{Items in each set.}

\item{n_sets, n_groups}{Numbers of item sets and person groups.}

\item{set_unit_ratio, group_unit_ratio}{Geometric span of the set and group
units across their levels (1 = equal units, i.e. an ordinary Rasch fit).}

\item{theta_sd}{Spread of person ability.}

\item{seed}{Optional RNG seed.}
}
\value{
A wide data frame of class \code{"rasch_sim"} (\code{id}, item
  columns, \code{group}) with \code{attr(x, "truth")$item_sets} the set map
  to pass to \code{\link{rasch_efrm}}.
}
\description{
Generates data whose latent unit differs across item-set by person-group
frames (Humphry 2005): a person in group g responding to an item in set s
does so at the frame unit rho = alpha_set * phi_group scaling the whole
exponent. The planted set- and group-unit ratios are recovered by
\code{\link{rasch_efrm}}.
}
\examples{
d <- simulate_efrm(300, 8, set_unit_ratio = 1.3, seed = 1)
tr <- attr(d, "truth")
ef <- rasch_efrm(d, item_sets = tr$item_sets, groups = "group")
ef$alpha_table   # recovers the ~1.3 set-unit ratio
}
