r - Wild bootstrap and the order of observations -
i using wild boot strap in r through multiwayvcov package. used wild boot strap on 1 of regression models , obtained standard error estimates. however, when re-order observations in data set, different wild boot strap standard error estimates. have same number of observations before changing order of them in data set.
i checked make sure not doing wrong in re-ordering using ols , ols estimates hold regardless of ordering (as expected).
this makes me think ordering matters when using wild boot strap? seems little absurd because results should not contingent on ordering of observations in dataset. plus, don't see how wild boot strap procedure create such different estimates.
does have ideas on what's going on??
i give example. created random dataframe , ran ols regression 14 clusters, used wild boot strap:
test <- data.frame(replicate(10,sample(0:1,8000,rep=true))) ones <- seq(from=0, to=15, by=1) test$fe <- sample(ones, size=8000, replace=true) test.fit <- lm(x1 ~ x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10, data = test) set.seed(20170820) boot_firm <- cluster.boot(test.fit, test$fe, boot_type = "wild", wild_type = "rademacher") boot1 <- as.data.frame(boot_firm) coeftest(test.fit, boot_firm)
when this, obtain following results [abridged illustrative purposes]: t test of coefficients:
estimate std. error t value pr(>|t|) (intercept) 0.5347468 0.0146940 36.3923 < 2.2e-16 *** x2 -0.0058875 0.0112407 -0.5238 0.600458 x3 -0.0111349 0.0105876 -1.0517 0.292973
however, let alter order of observations in data frame:
test <- test[sample(1:nrow(test)),]
then, let run same regression before:
test.fit <- lm(x1 ~ x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10, data = test)
now estimate standard errors using wild boot strap again, results noticeably different:
set.seed(20170820) boot_firm <- cluster.boot(test.fit, test$fe, boot_type = "wild", wild_type = "rademacher") boot1 <- as.data.frame(boot_firm) coeftest(test.fit, boot_firm)
and results are:
t test of coefficients: estimate std. error t value pr(>|t|) (intercept) 0.5347468 0.0196871 27.1624 < 2e-16 *** x2 -0.0058875 0.0101777 -0.5785 0.56296 x3 -0.0111349 0.0085267 -1.3059 0.19163
i don't understand why occurs because, in expectation, wild boot strap procedure shouldn't result in such noticeable differences regardless of whether re-order observations.
Comments
Post a Comment