Open vdquadros opened 5 years ago
I had a meeting with Isaac on Thursday, Jan. 17th, and we went over those issues.
It looks like that when Isaac and Paul downloaded the data from ipums they didn't download exactly the same variables, so it's just a matter of re-downloading the appropriate variables and merging with the Bartik dataset.
I downloaded the variables:
BPLD (detailed) - Birthplace [detailed version]
YRIMMIG - Year of immigration
WKSWORK1 - Weeks worked last year
During data cleaning, Card randomly drops half of the observations for natives but keeps all of the observations for immigrants.
He then creates a "weight" variable that =2 if person is native and =1 if person in immigrant.
He then follows to using it in PROC MEANS and PROC GLM, such as:
proc means;
where (imm=0);
weight wt;
And also:
proc glm data=nm;
class eclass xclass homey;
model logwage2=exp exp2 exp3 educ eclass*xclass inschool advanced
ft lowhrs
hisp_ed hisp_coll black_ed black_coll asian_ed asian_coll
homey*eclass rmsa0 rmsa1 / solution;
output out=nm2 predicted=pred residual=res;
weight wt;
where the later is like an anova with "by" in stata.
When I read about how "weight" works in the PROC GLM, I find that
which seems to be what aweights are for in stata:
while pweights in stata are:
which is also true.
So what should I do? Note: Stata's anova only accepts aweights and fweights as options.
Should I use pweight to collapse the data (to calculate population over CZs, let's say) and use aweight to do anova?
Hi Victoria,
Here's my reconstruction of Card's logic, and then I'll talk about how to implement this. The reason that Card is giving double the weight to the native observations is that he has dropped half of the observations and so he is then doubling the weight on the natives to get back to the population.
Therefore, if you want to use "pweights" you should create a variable weight=2 for the native observation (so that the inverse of this is 0.5, which is the probability that the observation is included). You don't want to use aweights. In the anova command, "fweight" will do what you want. The stata help file says:
_> ( Frequency fweights indicate replicated data. The weight tells the
command how many observations each observation really represents. fweights allow data to be stored more parsimoniously. The weighting variable contains positive integers. The result of the command is the same as if you duplicated each observation however many times and then ran the command unweighted.)_
So here each native observation really represents 2 natives.
Hope that helps.
Isaac
_
Card:
In 1980, we have a statement like the one below. We don't have an equivalent one for 1990.
replace incwage=75000*1.43 if incwage == 75000 /*pareto fix*/
The codebook for 1980 says:
SPANISH 1 14
Spanish Origin
0 N/A (not of Spanish origin)
1 Mexican
2 Puerto Rican
3 Cuban
4 Other Spanish
And Card's code calls that variable "hispanic" and goes: if hispanic>=1 then hispanic=1
.
However, in 1990, Card uses a more detailed variable to define hispanic (since this variable didn't exist in 1980). The codebook is:
HISPAND:
0 not hispanic
100 mexican
102 mexican american
103 mexicano/mexicana
104 chicano/chicana
105 la raza
106 mexican american indian
107 mexico
200 puerto rican
300 cuban
[etc]
And Card's code is:
if dhisp=0 or (6<=dhisp<=199) then hispanic=0;
else hispanic=1;
Since "mexico" is 107, he doesn't consider Mexican as hispanic in 1990.
1. Defining who is immigrant
Card:
Defines as immigrant people who were naturalized citizen or who are still not citizens.
Victoria: Card + 4 + 5
2. Hours worked last year
Card: His data seems to have the exact number of weeks people worked last year. His code is the following:
annhrs=weeks*hrswkly;
That is, total annual hours = weeks * weekly hours
Victoria: The Bartik data has multiple bins for number of weeks worked last year.
Thus, I am currently getting an average of those.
3. Education labels
Card: Census data has exactly one category for each grade and it also has information on whether the person completed the grade.
Victoria: Bartik data has too many categories and the numbers don't really add up:
To see what I mean by "they don't really add up", consider:
4. Income measures
Card:
Then he defines self-employed as anyone who has a positive (selfinc + farminc)
Victoria:
Bartik dataset has no measure of self-employed earnings, so I will use this other variable to define self-employment:
https://www.dropbox.com/s/8jiij8ntdq1lcau/Screenshot%202019-01-16%2014.56.49.png?dl=0
5. Country codes - grouping into 38 groups
Card: The country codes used by Card can be found in Appendix F of the Codebook for the 1980 5% extracts, available from ICPSR.
He groups countries into 38 groups:
Somewhat unrelated note: Later on, Card creates even broader categories of countries (e.g., european, high asia, mid asia, mexico), and he includes Canada in the european group, Pakistan and Iran in the high asia group,
Victoria: Issue: The Bartik dataset doesn't have 15/38 groups used by Card:
For these groups, instead of using a person's place of birth I use whether the person is an immigrant combined with her primary ancestry (using the variable
ancestr1
). So if a person is an immigrant and her first response for ancestry is "salvadoran", I count her as having been born in El Salvador. This is of course not perfect, since some immigrants report being born in a country different than the ancestor.6. Years in the US
Card: Census data has the immigration year. So the 1980 Census, for example, has a variable that looks like
So he approximates how many years the person has been in the U.S. using that variable. This allows him to distinguish between people who have been in the U.S. for 20+ years vs. 40+ years.
Victoria: The Bartik data, on the other hand, only says if the person has been in the US for 21+ years, so don't have the same level of granularity and I am not sure how many years to put. Note: For each obs, we have the person's date of birth, so maybe we can use that to approx how many years in the U.S.
Right now, I am using 30 years for anyone who has been in the U.S. for 21+ years.