联系我们: 手动添加方式: 微信>添加朋友>企业微信联系人>13262280223 或者 QQ: 1483266981
这是一篇加拿大作业是一个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.
R数据分析|Assignment 3: Bootstrap tests and IV methods


发表评论