
**********************************************************************************
READ ME: STATA CODE FOR "THE COSTS AND BELIEFS IMPLIED BY DIRECT STOCK OWNERSHIP"
**********************************************************************************

The Stata code accomplishes two tasks: cleaning and organizing Survey of Consumer
Finances data, and calculating moments of the distribution of stock returns.

******************
SCF Code
******************
The Stata code uses raw data from the Survey of Consumer Finances
(https://www.federalreserve.gov/econresdata/scf/scf-previous-surveys.htm)
That data is not provided with this submission. However, the Stata files
will all execute correctly once you download the SCF data (1995, 1998, 2001, 2004, 2007)
and point the files to the folder where the data is stored.

The file "main.do" executes the full set of Stata files. This file executes individual .do
files for each SCF wave; for example SCF_2007.do. Each individual wave file reads the raw
SCF data from a folder called inputdata (for ease, you should name the folder this as well),
does some cleaning, and defines new variables.

Note that main.do creates a folder for cleaned/altered data, called "outputdata", as well
as for logfiles and outputtables (the latter two are unecessary, however).

Next, the main.do files runs merge.do, which combines all waves into a single sample. Then
the file clean.do does some final cleaning, and saves the data to be used in the Matlab
code: "wealth_and_wage_activeowner_20160418.csv".

The remaining files, "Regressions.do" and "beliefs_and_costs.do", produce the results in the
paper found in Tables 1, 2, 5, and 6. Regressions.do produces results in Tables 1 and 2, and
beliefs_and_costs.do produces results in Tables 5 and 6.


******************
CRSP Code
******************
The CRSP code has a single file, and is used to calculate mu, sigma^2, and V from Table 3.

Download the full set of CRSP monthly returns through 2010. Slight differences may arise
due to updates made to the CRSP returns data since 2011. Save the following fields in your
query: date comnam cusip shrcls ticker permno shrcd permco shrout prc ret
The code should then run and produce the mean monthly return (mu), the variance of the "market"
portfolio (sigma^2), and the variance of individual stock returns (V). These are given by
the variables "logstock" and "logmf".

