% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scf_design.R
\name{scf_design}
\alias{scf_design}
\title{Construct an SCF Multiply-Imputed Survey Object}
\usage{
scf_design(design, year, n_households)
}
\arguments{
\item{design}{A list of five \code{\link[survey:svrepdesign]{survey::svrepdesign()}} objects (one per implicate).}

\item{year}{Numeric SCF survey year (e.g., 2022).}

\item{n_households}{Numeric total U.S. households represented in \code{year}.}
}
\value{
An object of class "scf_mi_survey" with:
\describe{
\item{mi_design}{List of replicate-weighted designs (one per implicate).}
\item{year}{SCF survey year.}
\item{n_households}{Estimated number of U.S. households.}
}
}
\description{
Wraps a list of replicate-weighted survey designs into an \code{scf_mi_survey}
object. This is called internally by \code{\link[=scf_load]{scf_load()}}, but is also available
directly for users who construct their own implicate-level designs outside
the standard download-and-load workflow — for example, when integrating
external or custom-prepared SCF data files.

Each element of \code{design} must be a \code{\link[survey:svrepdesign]{survey::svrepdesign()}} object representing
one SCF implicate with replicate weights.
}
\examples{
# Do not implement these lines in real analysis:
# Use functions `scf_download()` and `scf_load()`
td <- tempfile("design_")
dir.create(td)

src <- system.file("extdata", "scf2022_mock_raw.rds", package = "scf")
file.copy(src, file.path(td, "scf2022.rds"), overwrite = TRUE)
scf2022 <- scf_load(2022, data_directory = td)

# Example for real analysis: Construct scf_mi_survey object
obj <- scf_design(
  design = scf2022$mi_design,
  year = 2022,
  n_households = attr(scf2022, "n_households")
)
class(obj)
length(obj$mi_design)

# Do not implement these lines in real analysis: Cleanup for package check
unlink(td, recursive = TRUE, force = TRUE)

}
\seealso{
\code{\link[=scf_load]{scf_load()}}, \code{\link[=scf_update]{scf_update()}}
}
