vdquadros / immigration_enclave

2 stars 3 forks source link

Bartik weights #10

Open vdquadros opened 5 years ago

vdquadros commented 5 years ago

Hi @econisaac,

Could you please take a look at this and make sure it makes sense/agrees with what we talked about in the meeting on Tuesday?

Thanks, Victoria

Dataset

To calculate the Bartik weights, I created a dataset of the form:

Code for weights

I am going to have two scripts, one for the high school-equivalent workers and one for the college-equivalent workers. I am copying below the code for HS-equivalent workers.

set seed 12345
use data/prepared_bartik.dta, clear

local controls logsize80 logsize90 coll80 coll90 ires80 nres80 mfg80 mfg90
local weight count90

local y resgap2
local x relshs
*local z shric*

local ind_stub shric*
local growth_stub hs_imm_ic*

* local time_var year
local cluster_var rmsa

foreach ind_var of varlist `ind_stub'* {
    replace `ind_var' = `ind_var' * 100
    }

forvalues k = 1(1)38 {
    egen agg_sh_ind_`k' = rowtotal(shric`k')
    }

bartik_weight, z(`ind_stub'*) weightstub(`growth_stub'*) x(`x') y(`y') controls(`controls') weight_var(`weight')
econisaac commented 5 years ago

That seems right. It looks ok, but either the code will run or not....