Skip to content

Instantly share code, notes, and snippets.

View matmo's full-sized avatar

Mathias matmo

View GitHub Profile
@matmo
matmo / keybase.md
Last active October 1, 2017 21:59
keybase.md

Keybase proof

I hereby claim:

  • I am matmo on github.
  • I am matmo (https://keybase.io/matmo) on keybase.
  • I have a public key ASBLpHxXVi2urgGgF3FM6pWLOxf29UP9bJMGB1aI82ChgAo

To claim this, I am signing this object:

@matmo
matmo / R-Code-Sagmeister-Migrant-Wage-Gap.R
Created August 11, 2017 08:45
R-Code-Sagmeister-Migrant-Wage-Gap.R
###### loading required packages
library(dplyr)
library(stargazer)
library(oaxaca)
library(knitr)
library(survey)
library(Hmisc)
library(matrixStats)
library(quantreg)
@matmo
matmo / quantreg-svyImputationList.R
Last active August 29, 2015 13:56
Quantile regression function for use with surveydesigns (survey package) and multiple imputations (with). Adapted from quantreg package.
rq.svyImputationList <- function (formula, tau = 0.5, design, weights=NULL, subset=NULL, na.action, method = "br",
model = TRUE, contrasts = NULL, ...)
{
if(!is.null(subset))
stop("Please specify the subset on the surveydesign")
call <- match.call()
mf <- model.frame(formula, model.frame(design), na.action = na.pass)
mt <- attr(mf, "terms")
if(is.null(weights))
weights <- weights(design)
@matmo
matmo / gist:7942205
Created December 13, 2013 09:59
Retrieve the US Census Tracts maps, clean and rearrange some states, merge them into one large shapefile. Requires gdal.
##----------------------------------------##
#- Download and edit US Census Tract Maps -#
#- Rearrange Hawaii/Alaska and Merge -#
#- https://github.com/matmo -#
##----------------------------------------##
library(maptools)
# download US census tract shapefiles
url <- "ftp://anonymous@ftp2.census.gov/geo/tiger/TIGER2010/TRACT/2010/"