# Survey of Consumer Finances (SCF)

The Survey of Consumer Finances (SCF) tracks the wealth of American families. Six thousand households answer a battery of questions about income, net worth, credit card debt, pensions, mortgages, even the lease on their cars. Plenty of surveys collect annual income, only the Survey of Consumer Finances captures such detailed asset data.

One set of five tables of survey responses and a separate table with replicate weights, each table containing with one row per sampled household. The set of five tables of survey responses contain successive replicates of each sampled households, used to properly account for statistical uncertainty.

A complex sample survey designed to generalize to the civilian non-institutional population of the United States.

Released triennially since 1989.

Administered by the Board of Governors of the Federal Reserve System.

## Simplified Download and Importation

The R `lodown`

package easily downloads and imports all available SCF microdata by simply specifying `"scf"`

with an `output_dir =`

parameter in the `lodown()`

function. Depending on your internet connection and computer processing speed, you might prefer to run this step overnight.

```
library(lodown)
lodown( "scf" , output_dir = file.path( path.expand( "~" ) , "SCF" ) )
```

`lodown`

also provides a catalog of available microdata extracts with the `get_catalog()`

function. After requesting the SCF catalog, you could pass a subsetted catalog through the `lodown()`

function in order to download and import specific extracts (rather than all available extracts).

```
library(lodown)
# examine all available SCF microdata files
scf_cat <-
get_catalog( "scf" ,
output_dir = file.path( path.expand( "~" ) , "SCF" ) )
# 2016 only
scf_cat <- subset( scf_cat , year == 2016 )
# download the microdata to your local computer
scf_cat <- lodown( "scf" , scf_cat )
```

## Analysis Examples with the `survey`

library

Construct a multiply-imputed, complex sample survey design:

```
library(survey)
library(mitools)
scf_imp <- readRDS( file.path( path.expand( "~" ) , "SCF" , "scf 2016.rds" ) )
scf_rw <- readRDS( file.path( path.expand( "~" ) , "SCF" , "scf 2016 rw.rds" ) )
scf_design <-
svrepdesign(
weights = ~wgt ,
repweights = scf_rw[ , -1 ] ,
data = imputationList( scf_imp ) ,
scale = 1 ,
rscales = rep( 1 / 998 , 999 ) ,
mse = FALSE ,
type = "other" ,
combined.weights = TRUE
)
```

### Variable Recoding

Add new columns to the data set:

```
scf_design <-
update(
scf_design ,
hhsex = factor( hhsex , labels = c( "male" , "female" ) ) ,
married = as.numeric( married == 1 ) ,
edcl =
factor(
edcl ,
labels =
c(
"less than high school" ,
"high school or GED" ,
"some college" ,
"college degree"
)
)
)
```

### Unweighted Counts

Count the unweighted number of records in the survey sample, overall and by groups:

```
scf_MIcombine( with( scf_design , svyby( ~ one , ~ one , unwtd.count ) ) )
scf_MIcombine( with( scf_design , svyby( ~ one , ~ hhsex , unwtd.count ) ) )
```

### Weighted Counts

Count the weighted size of the generalizable population, overall and by groups:

```
scf_MIcombine( with( scf_design , svytotal( ~ one ) ) )
scf_MIcombine( with( scf_design ,
svyby( ~ one , ~ hhsex , svytotal )
) )
```

### Descriptive Statistics

Calculate the mean (average) of a linear variable, overall and by groups:

```
scf_MIcombine( with( scf_design , svymean( ~ networth ) ) )
scf_MIcombine( with( scf_design ,
svyby( ~ networth , ~ hhsex , svymean )
) )
```

Calculate the distribution of a categorical variable, overall and by groups:

```
scf_MIcombine( with( scf_design , svymean( ~ edcl ) ) )
scf_MIcombine( with( scf_design ,
svyby( ~ edcl , ~ hhsex , svymean )
) )
```

Calculate the sum of a linear variable, overall and by groups:

```
scf_MIcombine( with( scf_design , svytotal( ~ networth ) ) )
scf_MIcombine( with( scf_design ,
svyby( ~ networth , ~ hhsex , svytotal )
) )
```

Calculate the weighted sum of a categorical variable, overall and by groups:

```
scf_MIcombine( with( scf_design , svytotal( ~ edcl ) ) )
scf_MIcombine( with( scf_design ,
svyby( ~ edcl , ~ hhsex , svytotal )
) )
```

Calculate the median (50th percentile) of a linear variable, overall and by groups:

```
scf_MIcombine( with( scf_design ,
svyquantile(
~ networth ,
0.5 , se = TRUE , method = 'constant' , interval.type = 'quantile'
) ) )
scf_MIcombine( with( scf_design ,
svyby(
~ networth , ~ hhsex , svyquantile ,
0.5 , se = TRUE , method = 'constant' , interval.type = 'quantile' ,
keep.var = TRUE , ci = TRUE
) ) )
```

Estimate a ratio:

```
scf_MIcombine( with( scf_design ,
svyratio( numerator = ~ income , denominator = ~ networth )
) )
```

### Subsetting

Restrict the survey design to labor force participants:

`sub_scf_design <- subset( scf_design , lf == 1 )`

Calculate the mean (average) of this subset:

`scf_MIcombine( with( sub_scf_design , svymean( ~ networth ) ) )`

### Measures of Uncertainty

Extract the coefficient, standard error, confidence interval, and coefficient of variation from any descriptive statistics function result, overall and by groups:

```
this_result <-
scf_MIcombine( with( scf_design ,
svymean( ~ networth )
) )
coef( this_result )
SE( this_result )
confint( this_result )
cv( this_result )
grouped_result <-
scf_MIcombine( with( scf_design ,
svyby( ~ networth , ~ hhsex , svymean )
) )
coef( grouped_result )
SE( grouped_result )
confint( grouped_result )
cv( grouped_result )
```

Calculate the degrees of freedom of any survey design object:

`degf( scf_design$designs[[1]] )`

Calculate the complex sample survey-adjusted variance of any statistic:

`scf_MIcombine( with( scf_design , svyvar( ~ networth ) ) )`

Include the complex sample design effect in the result for a specific statistic:

```
# SRS without replacement
scf_MIcombine( with( scf_design ,
svymean( ~ networth , deff = TRUE )
) )
# SRS with replacement
scf_MIcombine( with( scf_design ,
svymean( ~ networth , deff = "replace" )
) )
```

Compute confidence intervals for proportions using methods that may be more accurate near 0 and 1. See `?svyciprop`

for alternatives:

```
MIsvyciprop( ~ married , scf_design ,
method = "likelihood" )
```

### Regression Models and Tests of Association

Perform a design-based t-test:

`MIsvyttest( networth ~ married , scf_design )`

Perform a chi-squared test of association for survey data:

`MIsvychisq( ~ married + edcl , scf_design )`

Perform a survey-weighted generalized linear model:

```
glm_result <-
scf_MIcombine( with( scf_design ,
svyglm( networth ~ married + edcl )
) )
summary( glm_result )
```

## Poverty and Inequality Estimation with `convey`

The R `convey`

library estimates measures of income concentration, poverty, inequality, and wellbeing. This textbook details the available features. As a starting point for SCF users, this code calculates the gini coefficient on complex sample survey data:

```
library(convey)
scf_design$designs <- lapply( scf_design$designs , convey_prep )
scf_MIcombine( with( scf_design , svygini( ~ networth ) ) )
```

## Replication Example

The statistics computed off of the public use file come very close to the net worth estimates in Table 2 of the bulletin but do not match exactly. A member of the SCF staff at the Federal Reserve re-ran the net worth calculations using the 2016 public use file to confirm that the calculations presented on this page follow the correct methodology.

```
# compute mean net worth using the 2016 PUF
mean_net_worth <- scf_MIcombine( with( scf_design , svymean( ~ networth ) ) )
# confirm the estimate and standard error match FRB calculations within one dollar
stopifnot( round( coef( mean_net_worth ) ) == 689509 )
stopifnot( round( SE( mean_net_worth ) ) == 12670 )
# compute median net worth using the 2016 PUF
median_net_worth <-
scf_MIcombine( with( scf_design ,
svyquantile(
~ networth ,
0.5 , se = TRUE , method = 'constant' , interval.type = 'quantile' ,
keep.var = TRUE , ci = TRUE
) ) )
# confirm the estimate and standard error match FRB calculations within one dollar
stopifnot( round( coef( median_net_worth ) ) == 97306 )
stopifnot( round( SE( median_net_worth ) ) == 2699 )
```