# scf 1.2.0

A major update.  Version 1.1.0 was about to be released, and then the Fed released the 2025 data.  Version 1.2.0 focused on updating for the 2025 data and validating that update against Fed official statistics.  Version updates since 1.0.10 added several features and fixes (listed below).

## New features

* Add the 2025 survey to `scf_download()` and `scf_load()`
* Record the dollar year of the Fed's summary variables in each file and `scf_mi_survey` object; older files get it from the data
* Add 2025 CPI-U-RS values and the new 2025 dollar variables `vacation` and `totspendnh`
* Add a `variance` argument to choose the Fed's method (default) or Rubin's rules for standard errors; see `?scf_variance`
* Add `scf_ratio()` for ratios of totals
* Add `scf_real()` to convert raw `x` dollar variables to real dollars
* Add `confint()` for models, `summary()` for `scf_prop_test` and `scf_ratio`, and `print()` for `scf_MIcombine` results
* Add observation counts (`nobs`, `nobs_mean`) to model fit statistics

## Changes that may affect existing code

* The Fed now gives the summary variables of every year in 2025 dollars, so files downloaded since October 2026 are in 2025 dollars and earlier downloads are in 2022 dollars. `scf_real()` converts to the data's dollar year, `scf_nominal()` converts from it by default, and `scf_load()` warns when loaded years are in different dollar years
* Rename `scf_deflate()` to `scf_nominal()`; `scf_deflate()` still works but is deprecated
* `scf_nominal()` stops if a result is for a variable not in real dollars, unless `force = TRUE`
* Rename the first argument of `scf_update()` to `.object`
* `scf_glm()`, `scf_logit()`, and `scf_prop_test()` report t and Rubin's degrees of freedom; `z.value` is now `t.value`
* `scf_quantreg()` uses replicate-weight standard errors by default and no longer reports AIC
* `scf_regtable()` chooses decimal places by size unless `digits` is given, and lists terms in model order
* Functions stop if a variable has missing values, or if a model or estimate fails in any implicate
* Mock data give one message from `scf_load()` instead of a warning from every function
* `scf_glm()` reports each distinct warning once, with the implicates it came from
* Remove `...` from `scf_logit()`; drop the `rlang` dependency
* `scf_mean()`, `scf_median()`, `scf_percentile()`, and `scf_freq()` results have an `n` column (households per row) and warn about groups of 10 or fewer households
* `scf_freq()` results always have a `group` column (`"All"` without `by`), so the columns are the same with and without `by`
* `scf_median()` and `scf_plot_cbar()` take `method = "stack"`, the Fed's method for its published tables
* `scf_glm()` has no default `family`; give one, such as `family = poisson()`. Use `scf_ols()` or `scf_logit()` for linear or logistic regression
* `scf_ratio()` results always have a `group` column (`"All"` without `by`)
* With `xlim`, `scf_plot_smooth()` shows shares of all households instead of shares within the range
* Printed stack-method percentiles and medians leave out the empty standard-error columns

## Major fixes

* Fix replicate-weight standard errors to match the Fed's method; previous standard errors were too large
* Fix weight scale so totals and household counts are correct
* Fix standard errors in `scf_xtab`, `scf_corr`, `scf_prop_test`, and two-sample `scf_ttest`
* Fix `confint()` for `scf_logit` odds ratios
* Fix model results that were very large when saved. `survey::svyglm()` ties each implicate fit to the full survey design, so `save()`, `saveRDS()`, and knitr's cache wrote out a copy of the design for every implicate of every model (about 5 GB for one `scf_logit()` on the 2022 data). `scf_glm()`, `scf_logit()`, and `scf_ols()` now drop that link. Estimates and other results are unchanged.

## Bug fixes

* `scf_quantreg`: R1, and stop on collinear terms
* `scf_regtable`: AIC, LaTeX and Markdown output, mixed model types
* `scf_corr`: use survey weights
* `scf_pctile_sum`: tied values at group boundaries
* `scf_nominal`: stack-method percentiles and dollar label
* Grouped results and `scf_freq` when a group is missing from some implicates
* Models: stop when a factor level is missing from some implicates, instead of dropping the term
* `scf_subset`: local variables, empty subsets, object size
* `scf_implicates` for `scf_glm`, `scf_quantreg`, `scf_xtab`, and `scf_corr`
* `scf_MIcombine`: `missinfo` with several coefficients
* `predict()`, and `summary()` for two-sample `scf_ttest` and `scf_logit` with `odds = FALSE`
* Transformed variables such as `~log(income + 1)` in `scf_corr`, `scf_ttest`, and `scf_prop_test`
* `scf_xtab` labels containing a colon
* `scf_load` when the first year is not a survey year
* `scf_logit` printed p-values
* Plots: weights in `scf_plot_hex` and `scf_plot_smooth`; bar order in `scf_plot_cbar`, `scf_plot_dbar`, and `scf_plot_dist`; empty bins in `scf_plot_hist`; label maps
* Pass on warnings from `scf_glm` and `scf_percentile`
* Re-export `survey::SE`, and add `SE()` for `scf_mean`, `scf_median`, `scf_percentile`, `scf_ratio`, and model results
* Survey warnings in `scf_mean()`, `scf_percentile()`, `scf_freq()`, and `scf_ratio()` are reported once, with the implicates they came from
* `scf_update()` ignores a trailing comma
* `scf_percentile(method = "stack")` orders groups the same way as the default method
* `scf_plot_smooth()` no longer prints a message about the smoothing formula
* Reduce size of stored model objects

# scf 1.0.11

* Fix `scf_deflate()`

# scf 1.0.10

* Fix to axis display in bivariate plot functions

# scf 1.0.9

* Fixed minor calculation issue with `scf_pctile_sum()`

# scf 1.0.8

* Fixed display order problem with `scf_plot_hist()`

# scf 1.0.7

* `scf_pctile_cut()` reconceptualized as `scf_pctile_sum()` with integrated calls for stats
* Added function handling to `scf_update_by_implicate()` and updated cascading dependencies
* Update `scf_percentile()` to handle SCF stack method for percentile estimation
* Added `scf_deflate()` to convert nominal dollar estimates to real terms. Applies CPI-U-RS deflation factors (taken from the Federal Reserve Board's SCF Bulletin SAS macro) to results from `scf_mean()`, `scf_median()`, `scf_percentile()`, and `scf_ttest()`. Both point estimates and standard errors are rescaled; t-statistics, degrees of freedom, and p-values are left unchanged.
* Fixed a memory bloat issue in `scf_ols()`, `scf_glm()`, and `scf_logit()` where the full survey design object (data plus 999 replicate weights per implicate) was retained in each stored implicate-level model. The design is now released after coefficient and variance extraction, reducing result object size by roughly 5x.
* Eliminated use of `<<-` in `scf_regtable()` error-handler closures; restructured `tryCatch()` calls to return values directly.

# scf 1.0.6

* Added `scf_quantreg()` for weighted quantile regression on multiply-imputed SCF data, with coefficient pooling across implicates.
* Added `scf_pctile_cut()` for creating percentile-based grouping variables, including both implicate-specific and Federal Reserve-style stacked percentile methods.
* Other miscellaneous minor fixes


# scf 1.0.5

* Correct error in standard error estimates for `scf_median()`, `scf_percentile()`, and `scf_mean()`
* Suppressed known `svyquantile()` replicate-weight warnings for cleaner output.
* Added S3 methods for `"scf_model_result"` (`coef`, `vcov`, `predict`, `AIC`, `residuals`, `formula`) and updated model output structure accordingly.
* Standardized temporary-directory handling and safe file cleanup across all examples.

# scf 1.0.4

* First version successfully published to CRAN.

# scf 1.0.3

* Created new mock data object for CRAN compliance.  Required altered testing across package.

# scf 1.0.2

* Minor nonfunctional error corrections to ensure CRAN compliance

# scf 1.0.1

* Minor nonfunctional changes to conform to CRAN submission standards
* Fixed `scf_load()` to expunge non-functioning deprecated artifacts
* removed scf_extract_implicates() as it lost utility in `scf_load()` rebuild

# scf 1.0.0

* Initial release of the `scf` package.
* Implements functions for weighted, multiply-imputed SCF data analysis.
* Known benign warning: `"non-integer #successes in a binomial glm!"` during logistic regression (see [Stack Overflow](https://stackoverflow.com/questions/12953045/warning-non-integer-successes-in-a-binomial-glm-survey-packages)).
