10-K filings by day of the month

Here’s a cute picture. I was looking to sample 10-K filings and wondered whether I could assume they were well distributed over days of the month.

This picture required surprisingly little code to produce:

# Some parameters
min.year <- 1999
max.year <- 2010

# Pull data on number of filings by day of the month
library(RPostgreSQL)
drv <- dbDriver("PostgreSQL")
pg <- dbConnect(drv, db="crsp")

filing.data <- dbGetQuery(pg,paste("
    SELECT extract(year FROM date_filed) AS year_filed, 
        extract(day FROM date_filed) AS day_filed, count(*) AS num_10Ks_filed 
    FROM filings.filings 
    WHERE form_type='10-K'
        AND extract(year FROM date_filed) BETWEEN ",min.year, " AND ",max.year,
    "GROUP BY year_filed, day_filed ORDER BY year_filed, day_filed"))
filing.data$year_filed <- as.factor(filing.data$year_filed)

# Make a bar chart
library(lattice)
png(file="~/Dropbox/day_filed_10ks.png")

chart.title <- paste("Distribution of 10-K filings by day of month (",
                    min.year,"-",max.year,")", sep="")
barchart(day_filed ~ num_10ks_filed | year_filed, data=filing.data, 
         xlab="Number of 10-K filings",
         ylab="Day of month",
         main=chart.title,
        scales = list(y=list(at = seq(from=1,to=31, by=5))))
dev.off()
Advertisements
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s