Skip to content

Instantly share code, notes, and snippets.

@sfgreen
sfgreen / hayn_0_construct_sample.sas
Created October 5, 2017 18:19 — forked from JoostImpink/hayn_0_construct_sample.sas
Hayn 1995 replica, code to construct sample
/* We need to make a sample for US listed firms with fiscal years 1962-1990
From Compustat Funda we need:
- gvkey Firm identifier
- datadate End of fiscal year
- fyear Fiscal year
- epspx EPS before extraordinary items
- prcc_f Price at fiscal year end
- csho Common shares outstanding end of year (to compute market cap)
@mollietaylor
mollietaylor / log.R
Created June 23, 2013 22:58
Plot Weekly or Monthly Totals in R
library(ggplot2)
library(scales)
# load data:
log <- data.frame(Date = c("2013/05/25","2013/05/28","2013/05/31","2013/06/01","2013/06/02","2013/06/05","2013/06/07"),
Quantity = c(9,1,15,4,5,17,18))
log
str(log)
# convert date variable from factor to date format: