Code Monkey home page Code Monkey logo

dingelneiman-workathome's Introduction

This repository contains the code underlying the note "How Many Jobs Can be Done at Home?" by Jonathan I. Dingel and Brent Neiman. This is a complete replication package that produces all results from scratch, beginning with code that downloads all the required data from bls.gov and onetcenter.org.

Results

If you simply want to download our results without running any replication code, you can grab the following CSV files:

Code organization

The workflow is organized as a series of tasks. Each task folder contains three folders: input, code, output. A task's output is used as an input by one or more downstream tasks. This graph depicts the input-output relationships between tasks.

task-flow graph

We use the make utility to automate this workflow. After downloading this replication package (and installing the relevant software), you can reproduce the figures and tables appearing in the paper simply by typing make at the command line.

Software requirements

The project's tasks are implemented via Stata code and shell scripts. The taskflow structure employs symbolic links. To run the code, you must have installed Stata. We ran our code using Stata 14 and GNU bash version 3.2.57 on Mac OS X. We expect the code to work on other versions too.

Replication instructions

Download and run code

  1. Download (or clone) this repository by clicking the green Clone or download button above. Uncompress the ZIP file into a working directory on your cluster or local machine.
  2. From the Unix/Linux/MacOSX command line, navigate to directory containing this readme.
  3. Typing make will execute all the code. The Makefile will execute stata-se commands, so Mac OS X users should ensure stata-se is in their relevant PATH.

Notes

  • It is best to replicate the project using the make approach described above. Nonetheless, it is also possible to produce the results task-by-task in the order depicted in the flow chart. If all upstream tasks have been completed, you can complete a task by navigating to the task's code directory and typing make.
  • An internet connection is required so that the downloaddata task can download data.
  • If you want to create your own manual classification, edit the file Teleworkable_BNJDopinion.csv before running the code.

Windows users

You likely should install Windows Subsystem for Linux. Alternatively, my colleague says that "Windows users can install chocolatey, and then type choco install make on the command line." If you aren't able to use make, you can replicate the paper by following this list.

Acknowledgments

Thanks to Menglu Xu for research assistance. Thanks to Megan Fasules for spotting a bug in our initial code.

Related work

  • James Stratton applied our measures to Australian occupational codes. See his replication package for "How Many How Many Australians Can Work From Home? An Application of Dingel and Neiman (2020) to Australian Occupation Data".
  • Ole Agersnap wrote code to produce state-level measures. His code is available in state_measures.

dingelneiman-workathome's People

Contributors

jdingel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dingelneiman-workathome's Issues

Overestimating handsontools and outdoors_everyday

I discovered a possible overestimation of the variables handsontools and outdoors_everyday in onet_characteristics.do.

In line 40, you keep the percent distribution "CXP" scaleid for elementid ("4.C.2.d.1.g","4.C.2.a.1.c","4.C.2.a.1.d")

keep if scaleid=="CX" | inlist(elementid,"4.C.2.d.1.g","4.C.2.a.1.c","4.C.2.a.1.d")

But then, you use the same average "CX" methodology to define handsontools and outdoors_everyday in lines 46 and 48.

bys onetsoccode: egen byte handsontools = max(elementid=="4.C.2.d.1.g" & inrange(datavalue,3.5,5.0)==1)

I believe you are counting some occupations where the average data value (CX) is less than 4.5, but some of the CXP data values happen to be between 4.5 and 5.

For example, O.NET.SOC.Code "11-3071.01" is classified as outdoors_everyday == 1, but the CX data value for "4.C.2.a.1.c" is 3.18, and the data value for "4.C.2.a.1.d" is 2.04.

For "4.C.2.a.1.d", the "CXP" data value for category 5 is 4.8, which is why I think this is defining outdoors_everyday == 1 when it should be 0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.