% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/core-classes.R
\name{survey_replicate}
\alias{survey_replicate}
\title{Replicate Weights Survey Design}
\usage{
survey_replicate(
  data = data.frame(),
  metadata = survey_metadata(),
  variables = list(),
  groups = character(0),
  call = NULL
)
}
\arguments{
\item{data}{A \code{data.frame} containing the survey data. Prefer
\code{\link[=as_survey_replicate]{as_survey_replicate()}} over calling this constructor directly.}

\item{metadata}{A \link{survey_metadata} object. Created automatically by
\code{\link[=as_survey_replicate]{as_survey_replicate()}}.}

\item{variables}{A named list of design specification (weights,
repweights, type, scale, rscales, fpc, fpctype, mse). Set
automatically by \code{\link[=as_survey_replicate]{as_survey_replicate()}}.}

\item{groups}{Set by surveytidy's \code{group_by()}. Always \code{character(0)} in
standalone surveycore use.}

\item{call}{Language object capturing the construction call.}
}
\value{
A \code{survey_replicate} object.
}
\description{
A survey design object using replicate weights for variance estimation.
Create with \code{\link[=as_survey_replicate]{as_survey_replicate()}}.
}
\section{Design variables (\verb{@variables})}{

\describe{
\item{\code{weights}}{Character string naming the weight column.}
\item{\code{repweights}}{Character vector of replicate weight column names.
The replicate weight matrix is computed on demand from
\code{design@data[, design@variables$repweights]} — it is not stored as
a property.}
\item{\code{type}}{Replicate weight method: one of \code{"JK1"}, \code{"JK2"},
\code{"JKn"}, \code{"BRR"}, \code{"Fay"}, \code{"bootstrap"}, \code{"ACS"},
\code{"successive-difference"}, or \code{"other"}.}
\item{\code{scale}}{Numeric scaling factor for variance estimation.}
\item{\code{rscales}}{Numeric vector of replicate-specific scales, or
\code{NULL}.}
\item{\code{fpc}}{FPC column name or \code{NULL}.}
\item{\code{fpctype}}{\code{"fraction"} or \code{"correction"}.}
\item{\code{mse}}{Logical. Use MSE estimates?}
}
}

\examples{
# Prefer as_survey_replicate() over calling survey_replicate() directly
set.seed(1)
df <- data.frame(y = rnorm(20), wt = runif(20, 1, 3),
                 rep1 = runif(20, 0.5, 2), rep2 = runif(20, 0.5, 2))
d <- as_survey_replicate(df, weights = wt,
                         repweights = starts_with("rep"), type = "BRR")
class(d)

}
\seealso{
\code{\link[=as_survey_replicate]{as_survey_replicate()}} to create a \code{survey_replicate} object.

Other constructors: 
\code{\link{as_survey}()},
\code{\link{as_survey_nonprob}()},
\code{\link{as_survey_replicate}()},
\code{\link{as_survey_twophase}()},
\code{\link{survey_data}()},
\code{\link{survey_glm}()},
\code{\link{survey_glm_fit}()},
\code{\link{survey_nonprob}()},
\code{\link{survey_taylor}()},
\code{\link{survey_twophase}()}
}
\concept{constructors}
