Skip to content

Instantly share code, notes, and snippets.

View alexchinco's full-sized avatar

Alex Chinco alexchinco

View GitHub Profile
@alexchinco
alexchinco / compute-idiosyncratic-volatility--04may2015.sas
Created May 5, 2015 15:23
Code for figures in "Comparing explanations for the idiosyncratic-return volatility puzzle".
;/*************************************************************************************
@author: Alex Chinco
@date: May 4th, 2015
**************************************************************************************/
OPTIONS LINESIZE = 208;
OPTIONS PAGESIZE = 208;
LIBNAME crsp '/wrds/crsp/sasdata/a_stock';
LIBNAME cboe '/wrds/cboe/sasdata';
@alexchinco
alexchinco / R code: Price of aggregate volatility
Created May 15, 2014 15:08
Code to replicate main results in Ang, Hodrick, Xing, and Zhang (2006)
## Prep workspace
rm(list=ls())
library(foreign)
library(grid)
library(plyr)
library(ggplot2)
library(tikzDevice)
print(options('tikzLatexPackages'))
options(tikzLatexPackages =
@alexchinco
alexchinco / ticker-data.csv
Created July 18, 2014 02:07
List of S&P 500 companies from 01/01/2008 to 12/31/2012.
ticker name t1 t2 interval
A "Agilent Technologies" 2008-01-01 2012-12-31 5.00547945205479
AA "Alcoa" 2008-01-01 2012-12-31 5.00547945205479
AAPL "Apple" 2008-01-01 2012-12-31 5.00547945205479
ABBV "AbbVie" 2012-12-31 2012-12-31 0.00273972602739726
ABC "AmerisourceBergen" 2008-01-01 2012-12-31 5.00547945205479
ABK "Ambac Financial" 2008-01-01 2008-06-10 0.443835616438356
ABT "Abbot Laboratories" 2008-01-01 2012-12-31 5.00547945205479
ACE "ACE Limited" 2010-07-14 2012-12-31 2.47123287671233
ACN "Accenture" 2011-07-05 2012-12-31 1.4958904109589
@alexchinco
alexchinco / FullSurvey.qsf
Created August 3, 2020 17:22
QSF files so that researchers can run online survey experiments in Chinco, Hartzmark, and Sussman (2020).
{
"SurveyEntry": {
"SurveyID": "SV_blrl3RFOcL7Ht53",
"SurveyName": "Mutual fund vs. Bond Sample for Survey Curious",
"SurveyDescription": null,
"SurveyOwnerID": "UR_0e4Wr6osIKPvqNn",
"SurveyBrandID": "chicagobooth",
"DivisionID": "DV_a9PVFYw92ZwrUUJ",
"SurveyLanguage": "EN",
"SurveyActiveResponseSet": "RS_7X9X3aYlfcaUmJ7",
@alexchinco
alexchinco / prog--lasso-forecast--simulated-data--dense-shocks--04dec2015.R
Created December 5, 2015 17:07
Simulation analysis of using the LASSO to forecast stock returns.
###########################################################################
###########################################################################
## @purpose: Simulate return data with dense shocks and show that the
## LASSO doesn't add any forecasting power.
## ------------------------------------------------------------------------
## @author: Alex Chinco
## @date: 04-DEC-2015
###########################################################################
###########################################################################
@alexchinco
alexchinco / survey_variant_no_graph.QSF
Created February 11, 2021 16:33
Survey Variant, No Graph
{"SurveyEntry":{"SurveyID":"SV_0xHnIjV2NsCub2d","SurveyName":"Mutual fund vs. Bond NO IMAGES TEMPLATE","SurveyDescription":null,"SurveyOwnerID":"UR_0e4Wr6osIKPvqNn","SurveyBrandID":"chicagobooth","DivisionID":"DV_a9PVFYw92ZwrUUJ","SurveyLanguage":"EN","SurveyActiveResponseSet":"RS_cHdi9iB1ZCQyCFL","SurveyStatus":"Inactive","SurveyStartDate":"0000-00-00 00:00:00","SurveyExpirationDate":"0000-00-00 00:00:00","SurveyCreationDate":"2020-02-07 12:39:12","CreatorID":"UR_0e4Wr6osIKPvqNn","LastModified":"2020-12-16 16:36:45","LastAccessed":"0000-00-00 00:00:00","LastActivated":"0000-00-00 00:00:00","Deleted":null},"SurveyElements":[{"SurveyID":"SV_0xHnIjV2NsCub2d","Element":"BL","PrimaryAttribute":"Survey Blocks","SecondaryAttribute":null,"TertiaryAttribute":null,"Payload":{"1":{"Type":"Trash","Description":"Trash \/ Unused Questions","ID":"BL_erGOfrK4v8i6EHb","BlockElements":[{"Type":"Question","QuestionID":"QID279"},{"Type":"Question","QuestionID":"QID278"},{"Type":"Question","QuestionID":"QID280"},{"Type":"Questio
@alexchinco
alexchinco / survey_variant_scatterplot.QSF
Created February 11, 2021 16:32
Survey Variant, Scatterplot
{"SurveyEntry":{"SurveyID":"SV_9RJ3Kv5JBdHTB53","SurveyName":"Mutual fund vs. Bond scatter","SurveyDescription":null,"SurveyOwnerID":"UR_0e4Wr6osIKPvqNn","SurveyBrandID":"chicagobooth","DivisionID":"DV_a9PVFYw92ZwrUUJ","SurveyLanguage":"EN","SurveyActiveResponseSet":"RS_9KzalMb4MsnT8PP","SurveyStatus":"Active","SurveyStartDate":"0000-00-00 00:00:00","SurveyExpirationDate":"0000-00-00 00:00:00","SurveyCreationDate":"2020-03-12 09:26:11","CreatorID":"UR_0e4Wr6osIKPvqNn","LastModified":"2020-12-16 16:30:05","LastAccessed":"0000-00-00 00:00:00","LastActivated":"2020-03-19 08:55:38","Deleted":null},"SurveyElements":[{"SurveyID":"SV_9RJ3Kv5JBdHTB53","Element":"BL","PrimaryAttribute":"Survey Blocks","SecondaryAttribute":null,"TertiaryAttribute":null,"Payload":{"1":{"Type":"Trash","Description":"Trash \/ Unused Questions","ID":"BL_erGOfrK4v8i6EHb","BlockElements":[{"Type":"Question","QuestionID":"QID279"},{"Type":"Question","QuestionID":"QID278"},{"Type":"Question","QuestionID":"QID280"},{"Type":"Question","QuestionI
@alexchinco
alexchinco / survey_variant_single_stock.QSF
Created February 11, 2021 16:31
Survey Variant, Single Stock
{"SurveyEntry":{"SurveyID":"SV_aaTXFYqDX70Cbno","SurveyName":"Mutual fund vs. Bond Indiv Stock","SurveyDescription":null,"SurveyOwnerID":"UR_0e4Wr6osIKPvqNn","SurveyBrandID":"chicagobooth","DivisionID":"DV_a9PVFYw92ZwrUUJ","SurveyLanguage":"EN","SurveyActiveResponseSet":"RS_5nZHj3wM7YVGukS","SurveyStatus":"Active","SurveyStartDate":"0000-00-00 00:00:00","SurveyExpirationDate":"0000-00-00 00:00:00","SurveyCreationDate":"2021-01-20 13:39:44","CreatorID":"UR_0e4Wr6osIKPvqNn","LastModified":"2021-02-10 10:41:29","LastAccessed":"0000-00-00 00:00:00","LastActivated":"2021-01-20 13:49:40","Deleted":null},"SurveyElements":[{"SurveyID":"SV_aaTXFYqDX70Cbno","Element":"BL","PrimaryAttribute":"Survey Blocks","SecondaryAttribute":null,"TertiaryAttribute":null,"Payload":{"1":{"Type":"Trash","Description":"Trash \/ Unused Questions","ID":"BL_erGOfrK4v8i6EHb","BlockElements":[{"Type":"Question","QuestionID":"QID279"},{"Type":"Question","QuestionID":"QID278"},{"Type":"Question","QuestionID":"QID280"},{"Type":"Question","Quest
@alexchinco
alexchinco / survey_variant_stable_predictor.QSF
Created February 11, 2021 16:30
Survey Variant, Stable Predictor
{"SurveyEntry":{"SurveyID":"SV_bQ7bc7jA7EeDB41","SurveyName":"Mutual fund vs. Bond for ECON new language 101320","SurveyDescription":null,"SurveyOwnerID":"UR_0e4Wr6osIKPvqNn","SurveyBrandID":"chicagobooth","DivisionID":"DV_a9PVFYw92ZwrUUJ","SurveyLanguage":"EN","SurveyActiveResponseSet":"RS_bO9poszXRhEJC6N","SurveyStatus":"Active","SurveyStartDate":"0000-00-00 00:00:00","SurveyExpirationDate":"0000-00-00 00:00:00","SurveyCreationDate":"2020-10-13 10:41:57","CreatorID":"UR_0e4Wr6osIKPvqNn","LastModified":"2020-12-16 16:28:50","LastAccessed":"0000-00-00 00:00:00","LastActivated":"2020-10-13 10:47:57","Deleted":null},"SurveyElements":[{"SurveyID":"SV_bQ7bc7jA7EeDB41","Element":"BL","PrimaryAttribute":"Survey Blocks","SecondaryAttribute":null,"TertiaryAttribute":null,"Payload":{"1":{"Type":"Trash","Description":"Trash \/ Unused Questions","ID":"BL_erGOfrK4v8i6EHb","BlockElements":[{"Type":"Question","QuestionID":"QID193"},{"Type":"Question","QuestionID":"QID98"},{"Type":"Question","QuestionID":"QID100"},{"Type":"
@alexchinco
alexchinco / survey_variant_marginal_decision.QSF
Created February 11, 2021 16:29
Survey Variant, Marginal Decision
{"SurveyEntry":{"SurveyID":"SV_8jquVQy3YN1L3ZH","SurveyName":"Mutual fund vs. Bond Portfolio Language","SurveyDescription":null,"SurveyOwnerID":"UR_0e4Wr6osIKPvqNn","SurveyBrandID":"chicagobooth","DivisionID":"DV_a9PVFYw92ZwrUUJ","SurveyLanguage":"EN","SurveyActiveResponseSet":"RS_8bHv1ePSVgQGTJ3","SurveyStatus":"Active","SurveyStartDate":"0000-00-00 00:00:00","SurveyExpirationDate":"0000-00-00 00:00:00","SurveyCreationDate":"2020-10-14 12:38:14","CreatorID":"UR_0e4Wr6osIKPvqNn","LastModified":"2021-02-10 13:14:58","LastAccessed":"0000-00-00 00:00:00","LastActivated":"2020-10-14 12:43:37","Deleted":null},"SurveyElements":[{"SurveyID":"SV_8jquVQy3YN1L3ZH","Element":"BL","PrimaryAttribute":"Survey Blocks","SecondaryAttribute":null,"TertiaryAttribute":null,"Payload":{"1":{"Type":"Trash","Description":"Trash \/ Unused Questions","ID":"BL_erGOfrK4v8i6EHb","BlockElements":[{"Type":"Question","QuestionID":"QID193"},{"Type":"Question","QuestionID":"QID98"},{"Type":"Question","QuestionID":"QID100"},{"Type":"Question",