Skip to content

Instantly share code, notes, and snippets.

View wuzzit_solver.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
grayclhn / RDROBUST-description
Last active Dec 28, 2015
Temporary mirror of the R code from CCT's rdrobust package (for linking and commenting purposes). The full version of this package is available at
View RDROBUST-description
Package: rdrobust
Type: Package
Title: Robust Data-Driven Statistical Inference in
Regression-Discontinuity Designs
Version: 0.80
Date: 2015-03-18
Author: Sebastian Calonico <>, Matias D. Cattaneo <>, Rocio Titiunik <>
Maintainer: Sebastian Calonico <>
Description: Regression-discontinuity (RD) designs are quasi-experimental research designs popular in social, behavioral and natural sciences. The RD design is usually employed to study the (local) causal effect of a treatment, intervention or policy. This package provides tools for data-driven graphical and analytical statistical inference in RD designs: rdrobust to construct local-polynomial point estimators and robust confidence intervals for average treatment effects at the cutoff in Sharp, Fuzzy and Kink RD settings, rdbwselect to perform bandwidth selection for the different procedures implemented, and rdplot to conduct exploratory data analysis (RD plots).
grayclhn / loop_ts.jl
Last active Oct 5, 2015
Simple loop-construction macro for Julia
View loop_ts.jl
using Base.Meta
macro loop_ts(ex)
l, r = ex.args
# Determine which symbol should become the loop index. We've assumed that
# the equation has the form `y[t+1] = ...` or `y[t] = ...`. In the first case
# we need to parse 't+1' to find the symbol (t); in the second case, we can
# just read it off.
idx =
grayclhn / macros.jl
Last active Jul 14, 2021
Utility macros and functions for Julia
View macros.jl
## Some useful and/or interesting Julia macros. I haven't seen many
## examples online, so I hope this might be useful for people trying
## to understand macros. Caveat Emptor; I don't understand them that
## well myself. Additions and improvements are more than welcome.
## Everything here is available under the MIT license (see bottom of
## file)
## - Gray Calhoun (@grayclhn) 10/17/2014
grayclhn / julia_macros_code.jl
Last active Aug 29, 2015
Code for Julia Macros post
View julia_macros_code.jl
# Copyright (c) 2014 Gray Calhoun.
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
grayclhn / idempotence_test.R
Last active Dec 18, 2015
Code for LU vs. QR decomposition in regression. Idempotence of projection matrices using the LU decomposition fails faster.
View idempotence_test.R
# Explicitly calculate the inverse by LU decomposition: LAPACK DGESV,
# then calculate the projection matrix X(X'X)^(-1)X'
projection.LU1 <- function(x)
x %*% solve(crossprod(x)) %*% t(x)
# Use DGESV but without explicitly calculating the inverse
projection.LU2 <- function(x)
crossprod(t(x), solve(crossprod(x), t(x)))
# Calculate the projection matrix using the QR decomposition
grayclhn / reinhart_rogoff_data.txt
Last active Dec 16, 2015
Supporting code for blog post on Reinhart Rogoff debate, <>. The data and almost all of the code are from Herndon, Ash, and Pollin's "Does High Public Debt Consistently Stifle Economic Growth? A Critique of Reinhart and Rogoff", available at…
View reinhart_rogoff_data.txt
grayclhn /
Last active Dec 15, 2015
csv files with game-by-game outcomes for the college basketball season (men's, 2013). A csv bracket too. Let me know when you find errors. Enjoy.

college_basketball_2013.csv has game outcomes for the 2012-2013 men's college basketball season.

  • Date: the date the game was played

  • HomeId: a unique numeric identifier for the home team

  • AwayId: a unique numeric identifier for the away team

  • HomeName: the name of the home team

  • AwayName: the name of the away team

  • HomeConf: the conference the home team belongs to

  • AwayConf: the conference the away team belongs to