% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/attrition.R
\name{wf_attrition}
\alias{wf_attrition}
\title{Estimate panel attrition weights}
\usage{
wf_attrition(
  panel,
  retained,
  formula,
  id = NULL,
  by = NULL,
  stabilize = TRUE,
  trim = NULL
)
}
\arguments{
\item{panel}{Full prior-wave panel data.}

\item{retained}{Column indicating whether each prior-wave unit was retained
into the next wave.}

\item{formula}{One-sided or two-sided formula naming retention predictors.}

\item{id}{Optional unique unit identifier column.}

\item{by}{Optional grouping column; separate retention models are fit by
group.}

\item{stabilize}{Whether to multiply inverse probabilities by the group
retention rate before normalization.}

\item{trim}{Optional positive scalar cap, applied as \code{trim * median(weight)}
within each group before mean-one normalization.}
}
\value{
A \code{wf_attrition_weights} object inheriting from \code{wf_weights}, with a
\verb{$balance} diagnostic table and per-group retention log.
}
\description{
Models wave-to-wave retention in a panel and returns inverse-retention
weights for retained units. The result inherits from \code{wf_weights}, so it can
be composed with later calibration stages through \code{\link[=wf_compose]{wf_compose()}}.
}
