Skip to content

Instantly share code, notes, and snippets.

View bbdaniels's full-sized avatar

Benjamin Daniels bbdaniels

View GitHub Profile
@bbdaniels
bbdaniels / verbatim.tex
Created May 13, 2019 19:54
Verbatim environment
\begin{Verbatim}
\end{Verbatim}
git submodule foreach --recursive git pull origin master
@bbdaniels
bbdaniels / stata-section.do
Created May 31, 2019 16:30
Stata section break
// Table : TITLE -------------------------------------------------------------------------------
@bbdaniels
bbdaniels / stata-header.do
Created May 31, 2019 16:34
Header for Stata dofiles
/* ---------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
M1 RHCP Paper Appendix
PURPOSE: Appendix materials for M1 RHCP Paper
OUTLINE:
PART 1: Tables for appendix
PART 2: Figures for appendix
@bbdaniels
bbdaniels / stata-section-head.do
Last active January 8, 2020 18:47
Stata section header
// ---------------------------------------------------------------------------------------------
// Figures
@bbdaniels
bbdaniels / .gitignore
Last active December 11, 2020 17:16
gitignore
########################################################################
#
# .gitignore DIME template
# https://github.com/worldbank/dime-github-trainings/tree/master/GitHub-resources/DIME-GitHub-Templates
#
# We recommend that you create a .gitignore file using GitHub's tools and
# replace the content of that file with the content of this file. Otherwise
# you have to rename this file .gitignore. But if you rename the fine in a
@bbdaniels
bbdaniels / ritest-demo.do
Last active October 23, 2019 14:27
Demo example for [ritest] in Stata
// [ritest] example
// Create randomization program ------------------------------------------------
cap prog drop my_randomization
prog def my_randomization
syntax , [*]
// Must drop the variable for [ritest]. Make sure to keep it saved somewhere
cap drop treatment
@bbdaniels
bbdaniels / wage-premium.do
Last active January 8, 2020 18:46
Mincer regression for Econ lecture
clear // Reset the work space
set obs 100000 // Create empty units of observation
set seed 837169 // Fix randomization start point
// Generate ability scores 0-100
gen theta = 100*runiform()
// Fix parameters
local a = 100
local b = 2
@bbdaniels
bbdaniels / loop-over-letters.do
Created January 9, 2020 22:04
Loop over letters in Stata (such as for putexcel)
forv i = 1/26 {
local theLetter : word `i' of `c(ALPHA)'
di "`theLetter'"
}
@bbdaniels
bbdaniels / One.do
Created January 10, 2020 22:12
Assignment
*Part I*
*** Setup
clear all //clear any open datasets
cls //clear the screen
version 15
set more off
set linesize 255
*** Generating a random varibale
set obs 100000