Task 2
(a) Replicate the descriptive statistics Table 1 on page 17 in the Orrenius and Zavodny paper.
Hint: You need to weight the observations somehow in this and all the subsequent tasks
to produce results that are identical to those in the Orrenius and Zavodny paper. 
(b) Comment the results from the table you created in (a).
 
Task 3
(a) Compare the sample means of employment and real weekly earnings for Mexicans and
Salvadorans, separately for men and women, as well as for less and more educated during
and after TPS. You should replicate the results in Table 2 on page 18 in the Orrenius and
Zavodny paper. In this task, it is not required to compute statistical signicances, as is
done in the paper. 
(b) What can you infer about the impact of the TPS program based on the results in (a)? 

Task 4
Use robust standard errors when doing regressions in Tasks 4 and 5.
(a) Analyze the eects of the TPS program on 7 dierent variables using Dierence-inDierences models where you compare Salvadorans and Mexicans, separately for men
and women, as well as less and more educated. You should replicate the results in Table
3 on page 19 in the Orrenius and Zavodny paper. Hint: Check the notes from Table 3 for
the correct specications. For the weekly earnings, consider using the natural logarithms
of the variables.
(b) Interpret the results from the table you produced in (a). 

Task 5
(a) Run a falsication test where you compare Salvadoran and Mexican immigrants that
arrived in 19941995 to those arrived in 19971998. Use the same specications as in Task
4. You should replicate the results in Table 5 on page 21 in the Orrenius and Zavodny
paper. 
(b) What is the point of this kind of a test? 
Task 6
What are your nal conclusions about the impact of the TPS program? 

Addendum:

Table 1 for task 2
Table 1
Descriptive statistics for recent immigrants from El Salvador, Guatemala and Mexico in
2005-2006
El Salvador Mexico Guatemala
Men Women Men Women Men Women
Employed 0.884 0.559 0.891 0.351 0.905 0.465
Unemployed 0.051 0.058 0.033 0.056 0.028 0.056
In labor force 0.935 0.617 0.904 0.407 0.933 0.521
Usual weekly hours 39.3 23.5 39.4 15.2 38.0 19.4
Annual weeks worked 44.7 27.9 44.0 16.5 45.2 22.3
Real weekly earnings $416.58 $306.20 $402.84 $285.04 $353.82 $326.83
Real weekly earnings $571.05 $416.12 $572.34 $441.85 $552.15 $442.74
in occupation
Age 31.7 33.0 30.4 31.6 29.3 29.9
Not completed high school 0.587 0.607 0.564 0.571 0.682 0.613
Completed high school 0.276 0.254 0.344 0.324 0.245 0.239
(no college)
Attended college 0.063 0.089 0.050 0.054 0.043 0.079
(no Bachelor’s degree)
Graduated from college 0.074 0.049 0.042 0.052 0.031 0.069
Number of observations 634 589 7643 7824 587 390
Note: Sample only includes immigrants ages 20-64 who reporting migrating to the United States
during 1999-2000 or 2002-2003 and not being a naturalized U.S. citizen. Real weekly earnings
and real weekly earnings in occupation (average earnings of U.S. natives in that occupation) are
conditional on being employed and adjusted for inflation using the CPI-W (2005 = 100).
Observations are weighted using the ACS person weights.

I already began solving this task this way:


data$sex <- factor(data$female, levels = c(0, 1), labels = c("Men", "Women"))
data$elsalv <- factor(data$elsalv, levels = c(0, 1), labels = c("No", "Yes"))
data$guatem <- factor(data$guatem, levels = c(0, 1), labels = c("No", "Yes"))
data$mexico <- factor(data$mexico, levels = c(0, 1), labels = c("No", "Yes"))

stats <- data %>%
  group_by(elsalv, guatem, mexico, sex) %>%
  summarise(
    employed = mean(employed, na.rm = TRUE),  # Adjust if 'employed' already exists as a variable
    unemployed = mean(unemployed, na.rm = TRUE),  # Adjust if 'unemployed' already exists as a variable
    in_labor_force = mean(in_labor_force, na.rm = TRUE),
    usual_weekly_hours = mean(uhrswork, na.rm = TRUE),
    annual_weeks_worked = mean(wkswork1, na.rm = TRUE),
    real_weekly_earnings = mean(rearnwk, na.rm = TRUE),  # Adjust based on what you want (e.g., rearnhr or rearnwk)
    age = mean(age, na.rm = TRUE),
    not_completed_high_school = mean(less_than_high_school, na.rm = TRUE),  # Adjust if needed
    completed_high_school = mean(high_school_completion, na.rm = TRUE),  # Adjust if needed
    attended_college = mean(some_college, na.rm = TRUE),  # Adjust if needed
    graduated_from_college = mean(bachelors_or_more, na.rm = TRUE),  # Adjust if needed
    num_observations = n()
  ) %>%
  ungroup()

print(stats)

> print(stats)
# A tibble: 6 × 16
  elsalv guatem mexico   sex employed unemployed in_labor_force usual_weekly_hours annual_weeks_worked real_weekly_earnings   age not_completed_high_school completed_high_school attended_college
   <dbl>  <dbl>  <dbl> <dbl>    <dbl>      <dbl>          <dbl>              <dbl>               <dbl>                <dbl> <dbl>                     <dbl>                 <dbl>            <dbl>
1      0      0      1     1    0.839     0.0440          0.883               38.8                42.3                 493.  36.1                     0.587                 0.313           0.0605
2      0      0      1     2    0.393     0.0628          0.456               17.5                19.4                 336.  36.6                     0.592                 0.293           0.0685
3      0      1      0     1    0.866     0.0321          0.899               38.7                43.2                 469.  34.1                     0.598                 0.273           0.0796
4      0      1      0     2    0.506     0.0696          0.576               21.5                25.3                 359.  35.7                     0.552                 0.280           0.106 
5      1      0      0     1    0.846     0.0472          0.893               39.3                43.7                 533.  36.3                     0.557                 0.309           0.0817
6      1      0      0     2    0.587     0.0669          0.653               24.8                29.7                 363.  37.6                     0.579                 0.285           0.0884
# ℹ 2 more variables: graduated_from_college <dbl>, num_observations <int

as we may notice task isn't well done and results are not weighted correctly so there is small misalign. Fix my code and then proceed to task 2b and so forth. answer to every question.

After this I just add info about my dataset:

> sapply(data, function(x) attr(x, "label"))
$year
[1] "Census year"

$datanum
[1] "Data set number"

$serial
[1] "Household serial number"

$hhwt
[1] "Household weight"

$statefip
[1] "State (FIPS code)"

$gq
[1] "Group quarters status"

$pernum
[1] "Person number in sample unit"

$perwt
[1] "ACS person weight"

$nchild
[1] "Number of own children in the household"

$nchlt5
[1] "Number of own children under age 5 in household"

$relate
[1] "Relationship to household head [general version]"

$age
[1] "Age"

$sex
NULL

$marst
[1] "Marital status"

$race
[1] "Race [general version]"

$bpl
[1] "Birthplace [general version]"

$citizen
[1] "Citizenship status"

$yrimmig
NULL

$hispan
[1] "Hispanic origin [general version]"

$school
[1] "School attendance"

$educ
[1] "Educational attainment [general version]"

$empstat
[1] "Employment status [general version]"

$occ
[1] "Occupation"

$occ1990
[1] "Occupation, 1990 basis"

$ind
[1] "Industry"

$ind1990
[1] "Industry, 1990 basis"

$classwkr
[1] "Class of worker [general version]"

$wkswork1
[1] "Weeks worked last year"

$uhrswork
[1] "Usual hours worked per week"

$incwage
[1] "Wage and salary income"

$qbpl
[1] "Flag for Bpl, Nativity"

$qempstat
[1] "Flag for Empstat, Labforce"

$qincwage
[1] "Flag for Incwage, Inctot, Incearn"

$mexico
[1] "Originally from Mexico"

$elsalv
[1] "Originally from El-Salvador"

$guatem
[1] "Originally from Guatemala"

$earnhr
[1] "Earnings per hour"

$earnwk
[1] "Earnings per week"

$rearnhr
[1] "Real hourly earnings (2005 base)"

$rearnwk
[1] "Real weekly earnings (2005 base)"

$rearnhr_occavgyr
[1] "Mean occup. hourly earn. for natives"

$rearnwk_occavgyr
[1] "Mean occup. weekly earn. for natives"

$statefip_factor
NULL

$statefip_1
NULL

$statefip_2
NULL

$statefip_4
NULL

$statefip_5
NULL

$statefip_6
NULL

$statefip_8
NULL

$statefip_9
NULL

$statefip_10
NULL

$statefip_11
NULL

$statefip_12
NULL

$statefip_13
NULL

$statefip_15
NULL

$statefip_16
NULL

$statefip_17
NULL

$statefip_18
NULL

$statefip_19
NULL

$statefip_20
NULL

$statefip_21
NULL

$statefip_22
NULL

$statefip_23
NULL

$statefip_24
NULL

$statefip_25
NULL

$statefip_26
NULL

$statefip_27
NULL

$statefip_28
NULL

$statefip_29
NULL

$statefip_30
NULL

$statefip_31
NULL

$statefip_32
NULL

$statefip_33
NULL

$statefip_34
NULL

$statefip_35
NULL

$statefip_36
NULL

$statefip_37
NULL

$statefip_38
NULL

$statefip_39
NULL

$statefip_40
NULL

$statefip_41
NULL

$statefip_42
NULL

$statefip_44
NULL

$statefip_45
NULL

$statefip_46
NULL

$statefip_47
NULL

$statefip_48
NULL

$statefip_49
NULL

$statefip_50
NULL

$statefip_51
NULL

$statefip_53
NULL

$statefip_54
NULL

$statefip_55
NULL

$statefip_56
NULL

$age2
NULL

$age3
NULL

$age4
NULL

$female
NULL

$married
NULL

$separated_divorced_widowed
NULL

$never_married
NULL

$less_than_high_school
NULL

$high_school_completion
NULL

$some_college
NULL

$bachelors_or_more
NULL

$years_in_usa
NULL

$employed
NULL

$unemployed
NULL

$in_labor_force
NULL

$rearnhr_fixed
NULL

$rearnwk_fixed
NULL

$rearnhr_occavgyr_fixed
NULL

$rearnwk_occavgyr_fixed
NULL

$log_rearnhr
NULL

$log_rearnwk
NULL

$log_rearnhr_occavgyr
NULL

$log_rearnwk_occavgyr
NULL