Skip to content

Instantly share code, notes, and snippets.

View btskinner's full-sized avatar

Benjamin Skinner btskinner

View GitHub Profile
@btskinner
btskinner / dummy_cat_labels.do
Last active May 6, 2023 16:58
A code snippet to create dummy variables from labeled categorical variables that attaches the appropriate label to the new variables.
// STATA CODE SNIPPET TO MAKE DUMMY VARIABLES FROM CATEGORICAL
// VARIABLES WHILE RETAINING VALUE LABELS
// Benjamin Skinner
// Vanderbilt University
// PURPOSE
// Sometimes we want dummy variables but instead have categorical
@btskinner
btskinner / ipeds_combine.r
Last active April 4, 2021 17:01
R code to create master IPEDS dataset from batch of IPEDS survey *.csv files
################################################################################
##
## COMBINE IPEDS DATASETS INTO A SINGLE WORKING DATASET
## Benjamin Skinner
##
################################################################################
## PURPOSE
## The purpose of this file is automate the process of:
@btskinner
btskinner / randomseat.r
Last active August 29, 2015 14:14
R code to create randomized seating assignment
################################################################################
##
## Seating Assignment Randomizer
## Benjamin Skinner
##
################################################################################
## This file randomizes seating assignment. It assumes that people are
## assigned to their seats sequentially: first through the door, first
## seat; second through the door, second seat...and so on. Every table
@btskinner
btskinner / csv2tex.r
Last active October 10, 2016 20:52
R code to convert matrix stored as csv file to TeX format
################################################################################
##
## CONVERT CSV MATRIX TO TEX FORMAT
## Benjamin Skinner
##
################################################################################
## PURPOSE
## If you have a matrix that has been stored as as csv file, e.g.,
@btskinner
btskinner / linkmarkdown.rb
Last active March 30, 2020 14:09 — forked from mignev/markdown-tag.rb
Ruby module to include online markdown files in Jekyll site
=begin
Tag to include markdown text from linked file (e.g. Github README.md)
Usage:
{% linkmarkdown <filename> %}
=end
require 'open-uri'
module Jekyll
class MarkdownTag < Liquid::Tag
@btskinner
btskinner / downloadipeds.r
Last active January 28, 2016 22:30
Gist to download all IPEDS survey files
################################################################################
##
## FILE: Download IPEDS files
##
################################################################################
## clear
rm(list = ls())
## read in files
@btskinner
btskinner / .emacs
Last active May 9, 2022 20:23
My .emacs file
;; -----------------------------------------------------------------------------
;;
;; [ FILE ] Emacs customization file
;; [ NAME ] .emacs
;; [ PATH ] ~/.emacs
;; [ AUTH ] Benjamin Skinner @btskinner
;; [ INIT ] 2 August 2017
;; [ REVN ] 22 May 2021
;;
;; -----------------------------------------------------------------------------
@btskinner
btskinner / stcrosswalk.tsv
Created April 26, 2016 15:12
Crosswalk for state census groupings
stfips stabbr stname cenreg cenregnm cendiv cendivnm
1 AL Alabama 3 South 6 East South Central
2 AK Alaska 4 West 9 Pacific
4 AZ Arizona 4 West 8 Mountain
5 AR Arkansas 3 South 7 West South Central
6 CA California 4 West 9 Pacific
8 CO Colorado 4 West 8 Mountain
9 CT Connecticut 1 Northeast 1 New England
10 DE Delaware 3 South 5 South Atlantic
11 DC District of Columbia 3 South 5 South Atlantic
@btskinner
btskinner / cnty_unem_medinc_make.R
Last active April 26, 2016 16:54
Historical county-level unemployment and median income
################################################################################
##
## FILE: cnty_unem_medinc_make.R
## AUTH: Benjamin Skinner
## INIT: 25 April 2016
##
################################################################################
## clear memory
rm(list = ls())
@btskinner
btskinner / fixbib.sh
Last active September 30, 2017 20:07
BibDesk to Jekyll scholar brace fix
#!/bin/bash
# PURPOSE
#
# To fix {{...}} used by BibDesk that don't play well with Jekyll scholar.
# Replaces {{...}} with "{...}". This respects capitalization and corporation
# names in the author field, but doesn't break Jekyll scholar.
#
# USAGE
#