Skip to content

Instantly share code, notes, and snippets.

View bbdaniels's full-sized avatar

Benjamin Daniels bbdaniels

View GitHub Profile
@bbdaniels
bbdaniels / stata-section-head.do
Last active January 8, 2020 18:47
Stata section header
// ---------------------------------------------------------------------------------------------
// Figures
@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.do
Created May 31, 2019 16:30
Stata section break
// Table : TITLE -------------------------------------------------------------------------------
git submodule foreach --recursive git pull origin master
@bbdaniels
bbdaniels / verbatim.tex
Created May 13, 2019 19:54
Verbatim environment
\begin{Verbatim}
\end{Verbatim}
@bbdaniels
bbdaniels / tufte-handout.tex
Created May 13, 2019 19:31
Minimal implementation of tufte-handout
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% How to use writeLaTeX:
%
% You edit the source code here on the left, and the preview on the
% right shows you the result within a few seconds.
%
% Bookmark this page and share the URL with your co-authors. They can
% edit at the same time!
%
% You can upload figures, bibliographies, custom classes and
@bbdaniels
bbdaniels / stata-percents.do
Last active January 25, 2024 19:20
Add percentage signs to bar graph labels
local nb=`.Graph.plotregion1.barlabels.arrnels'
qui forval i=1/`nb' {
.Graph.plotregion1.barlabels[`i'].text[1]="`.Graph.plotregion1.barlabels[`i'].text[1]'%"
}
.Graph.drawgraph
// Rounding
local nb=`.Graph.plotregion1.barlabels.arrnels'
forval i=1/`nb' {
.Graph.plotregion1.barlabels[`i'].text[1] = "`: di %2.0f `.Graph.plotregion1.barlabels[`i'].text[1]''"
@bbdaniels
bbdaniels / samplsi-sampclus.do
Created May 7, 2019 14:36
Power estimates for clustered samples
//Power calcs start here
sum l_household_income_total if (treatment == 0 & round == 1)
local mean1 = r(mean) //mean in control
local sd1 = r(sd) //SD in control
sum l_household_income_total if ((treatment == 1 | treatment == 2) & round == 1)
local mean2 = r(mean) //mean in AFSP
local sd2 = r(sd) //SD in AFSP
loneway l_household_income_total hhid_dvdc //--> 0.13
@bbdaniels
bbdaniels / web.bib
Last active April 30, 2019 20:03
Arbitrary citation
@article{downietraining,
author = {Downie, Richard},
title = {Training the Informal Health Workforce in India},
note={Center for Strategic and International Studies. Accessed: 2019-04-30.},
journal = {\url{https://www.csis.org/blogs/smart-global-health/training-informal-health-workforce-india}},
}
@bbdaniels
bbdaniels / sidenote-url.tex
Created April 24, 2019 22:02
SIdenote Wiki URL
\sidenote{\url{https://dimewiki.worldbank.org/wiki/PAGE}}