Learn R Programming

scf (version 1.0.5)

scf_implicates: Extract Implicate-Level Estimates from SCF Results

Description

Returns implicate-level outputs from SCF result objects produced by functions in the scf suite. Supports result objects containing implicate-level data frames, svystat summaries, or svyglm model fits.

Usage

scf_implicates(x, long = FALSE)

Value

A list of implicate-level data frames, or a single stacked data frame if long = TRUE.

Arguments

x

A result object containing implicate-level estimates (e.g., from scf_mean, scf_ols).

long

Logical. If TRUE, returns stacked data frame. If FALSE, returns list.

Usage

This function allows users to inspect how estimates vary across the SCF’s five implicates, which is important for diagnostics, robustness checks, and transparent reporting.

For example:

scf_implicates(scf_mean(scf2022, ~income))
scf_implicates(scf_ols(scf2022, networth ~ age + income), long = TRUE)

Examples

Run this code
# Do not implement these lines in real analysis:
# Use functions `scf_download()` and `scf_load()`
td <- tempfile("implicates_")
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: Extract implicate-level results
out <- scf_freq(scf2022, ~own)
scf_implicates(out, long = TRUE)

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

Run the code above in your browser using DataLab