本次作业代写是来自加拿大的关于一个R数据分析的assignment
Part 1: Bootstrap inference
For this part, use the dataset CPS1985 from the AER package. Then, select observations randomly using the following code with your student ID in the set.seed function. The idea is to have a small enough sample to make it beneficial to use bootstrap methods.
data(CPS1985, package=”AER”)
set.seed(112233)
## You will all have a different n
n <- sample(60:120, 1)
ind <- sample(534, size=n, replace=FALSE)
dat <- CPS1985[ind,]
1. Consider the following model
log(wage) = β0 + β1females + β2union + β3age + β4age2 + β5(females × union) + u ,
with females being 1 for female workers and union being 1 for workers who have a union job. We
want to construct confidence intervals for the gender gap in percentage for workers in union jobs and for
workers in non-union jobs. We approximate percentage gaps G12 between two groups (1 and 2) using
the following:
Compare the normal and percentile bootstrap confidence intervals using pairs and wild bootstrap .
Interpret your result.
2. Compare the intervals from the previous question with the one obtained using the Delta method.
Interpret the difference.
3. Consider the following model:
wage =β0 + β1education + β2females + β3experience + β4union
+ β5(females × education) + β6(females × union) + u .
Test the null hypothesis: If we hold experience and education constant, the gender gap for unionized
and non-unionized workers is equal, against the alternative that it is no equal at 5%. For each of the
following test, compute the p-value and interpret your result:
• T-test with asymptotic distribution
• Bootstrap T-test using pairs bootstrap
• Bootstrap T-test using the restricted wild bootstrap with the Rademacher distribution.