I hereby claim:
- I am sboysel on github.
- I am sboysel (https://keybase.io/sboysel) on keybase.
- I have a public key whose fingerprint is F0BB B0B8 886D 1CDB 392D E755 2E8D EF7C 3554 032D
To claim this, I am signing this object:
""" | |
simple way to get the directory path of the current file. | |
Extension: simply add additonal `.parent`s if __file__ is in a subdirectory of ROOT | |
""" | |
import pathlib | |
ROOT = pathlib.Path(__file__).parent |
import time | |
def timer(f): | |
""" | |
timer function decorator. Prints time elapsed (in seconds) of the function's | |
runttime. | |
Usage: | |
@timer |
[ | |
{ | |
"name": "Risha38", | |
"author": "Sam Boysel" | |
}, | |
[ | |
{ | |
"x": 2, | |
"f": 5 | |
}, |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env bash | |
# Evan Wilde <[email protected]> | |
# July 20, 2017 | |
# defaults | |
user="postgres" | |
passwd="" | |
host="localhost" | |
db="ghtorrent" | |
tmpdir='/tmp' |
select | |
num.TagName as Tag, | |
row_number() over (order by num.Num desc) as TotalRank, | |
rate.Rate as QuestionsInMay, | |
num.Num as QuestionsTotal | |
from | |
(select count(PostId) as Rate, TagName | |
from |
license: gpl-3.0 | |
height: 650 |
This note summarizes several tools for traditional econometric analysis using R
. The CRAN Task View - Econometrics provides a very comprehensive overview of available econometrics packages in R
. Rather the duplicate this resource, I will highlight several functions and tools that accommodate 95% of my econometric analyses.
stats::lm
- the standard OLS routine included in the base R
package stats
. The call summary(lm(y ~ x1 + x2, data = mydata))
produces output most similar to reg y x1 x2
in Stata.lfe
- Linear Fixed Effects models. In addition to efficiently handling high-dimension fixed effects, the workhorse function felm
also supports instrumental variables and clustered standard errors. As it improves lm
by incorplibrary(ggplot2) | |
library(maptools) | |
library(mapproj) | |
library(ggthemes) | |
library(sp) | |
library(raster) | |
library(rgeos) | |
library(RColorBrewer) | |
# Get administrative boundaries as SpatialPolygonsDataFrame |
# TODO: (1) What if I want to keep the remote zipfile after downloading? [x] | |
# (2) Other common formats: - GeoJSON [x] | |
# - KML [ ] | |
library(rgdal) | |
# Functions to check filenames | |
is_remote <- function(x) grepl("(ht|f)tp(s)?://", x) | |
is_zip <- function(x) grepl("\\.zip$", basename(x)) | |
is_shp <- function(x) grepl("\\.shp$", basename(x)) | |
is_json <- function(x) grepl("\\.(geo)?json$", basename(x)) |