This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#This script searches the Downloads folder for NBER working papers (PDFs starting with "w2") and renames them in "Author - Title (NBER Year)"" format. | |
cd ~/Downloads | |
papers=$(find . -name "w2[0-9]*.pdf" | sed 's/^.\//\ /' | sed 's/.pdf//' | tr -d '\n') | |
echo "$papers" | |
for wp in $papers | |
do | |
curl https://www.nber.org/papers/$wp.ris > temp.txt | |
grep 'AU' temp.txt | awk -F- '{print $2}' | awk -F, '{printf $1 ","}' > temp2.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#This script searches the Downloads folder for AEA journal articles and renames them in "Author - Title (journal Year)" format. | |
#On Mac OS X, you can't use \| in a basic regular expression, which is what "find" uses by default. | |
cd ~/Downloads | |
articles=$(find . -name "[ajmp][aeipo][clpr].[0-9]*.pdf" | sed 's/^.\//\ /' | sed 's/.pdf//' | tr -d '\n') | |
echo "$articles" | |
for article in $articles | |
do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for i in {100..115} | |
do | |
wget "https://www.essentialmix.nu/?modname=tracklistings&op=view&id=${i}" -O - | | |
grep -A 4 'Essential Mix</a> Archives' | tail -3 | sed 's/^.*\<b\>\([A-Za-z\ ].*\)\<\/b\> Broadcasted/\1/' | pandoc -f html -t plain | sed 's/\[\]//' | sed 's/^[[:space:]]*//' | sed 's/\-\-\-\-//g' | grep -v '^$' > temp.txt | |
filename=$(head -1 temp.txt | sed 's/on [SMTWF][a-z]*day/\-/' | | |
sed 's/\([0-9]*\)[rsth][dsth] \([JFMASOND][a-z]*\), \([12][90][901][0-9]\)/\3\.\2\.\1/' | | |
sed 's/January/01/' | sed 's/February/02/' | sed 's/March/03/' | sed 's/April/04/' | sed 's/May/05/' | sed 's/June/06/' | sed 's/July/07/' | sed 's/August/08/' | sed 's/September/09/' | sed 's/October/10/' | sed 's/November/11/' | sed 's/December/12/') | |
mv temp.txt "${filename}.txt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Examine age distribution: "Used to work from home and still do" response is monotonically increasing in age | |
import delimited using "https://raw.githubusercontent.com/johnjosephhorton/remote_work/master/etl/gcs.csv", clear | |
tab question1answer | |
tab question1answer age if strpos(question1answer,"None of the above")==0, col nof | |
//Checking against https://www.bls.gov/news.release/flex2.t01.htm, where the highest share of "Workers who did work at home" is 35 to 44 years at 32% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear all | |
import delimited using "https://raw.githubusercontent.com/jdingel/DingelNeiman-workathome/master/MSA_measures/output/MSA_workfromhome.csv", clear | |
drop if substr(area_name,-4,4)==", PR" //Drop Puerto Rico | |
clonevar cbsa = area | |
recode cbsa (70900=12700) (71650=14460) (78100=44140) (79600 = 49340) (70750 = 12620) (71950 = 14860) (72400 = 15540) (73450 = 25540) (94650=30340) (75700 = 35300) (76450 = 35980) (76750 = 38860) (77200 = 39300) (76600=38340) //Recode NECTAs to work with CBSA 2013 definitions | |
tempfile tf_msa_wfh | |
label variable teleworkable_emp "Share of jobs that can be done at home" | |
save `tf_msa_wfh' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import delimited using "https://raw.githubusercontent.com/COVIDExposureIndices/COVIDExposureIndices/master/dex_data/state_dex.csv", clear | |
keep state date dex num_devices dex_a num_devices_a | |
gen date_stata = date(date,"YMD") | |
format %td date_stata | |
gen baseline_date = mod(date_stata - 21934,7) | |
bys state baseline_date (date_stata): egen baseline_dex_a = total(dex_a * inrange(date_stata,0,21954)) | |
by state baseline_date (date_stata): egen baseline_denom = total(inrange(date_stata,0,21954)) | |
gen dex_a_relative = dex_a / (baseline_dex_a / baseline_denom) | |
gen byte Georgia = (state=="GA") | |
collapse (mean) dex_a_relative [w=num_devices], by(date_stata Georgia) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import delimited using "https://raw.githubusercontent.com/COVIDExposureIndices/COVIDExposureIndices/master/dex_data/state_dex.csv", clear | |
keep state date dex num_devices dex_a num_devices_a | |
gen date_stata = date(date,"YMD") | |
format %td date_stata | |
gen baseline_date = mod(date_stata - 21934,7) | |
bys state baseline_date (date_stata): egen baseline_dex_a = total(dex_a * inrange(date_stata,21974,21982)) | |
by state baseline_date (date_stata): egen baseline_denom = total(inrange(date_stata,21974,21982)) | |
gen dex_a_r = dex_a / (baseline_dex_a / baseline_denom) | |
collapse (min) dex_a_r_min = dex_a_r (max) dex_a_r_max = dex_a_r (p10) dex_a_r_10 = dex_a_r (p25) dex_a_r_25 = dex_a_r (p50) dex_a_r_50 = dex_a_r (p75) dex_a_r_75 = dex_a_r (p90) dex_a_r_90 = dex_a_r (p5) dex_a_r_05 = dex_a_r (p95) dex_a_r_95 = dex_a_r, by(date_stata) | |
gen byte ins = (inrange(date_stata, 21934+30,22039-21)==1) |