The bootstrap is often used for nonparametric inference. However, in some cases, it is useful to bootstrap and then conduct parametric tests within each resample (optionally, see References, but this is not required reading in any way for the question).
For example, you have a single continuous variable. You resample using a classical bootstrap, i.e., sampling with replacement. Then, within each resampled dataset, you conduct a hypothesis test that assumes independent observations, such as a standard $t$-test. Because there are repeated observations in the dataset, I would think that we have non-independent observations: the observations are "clustered" in the sense that all resampled observations mapping onto the same observation in the original dataset are 100% correlated.
More formally, say $Y$ is standard normal. Let $Y^{*}_i$ be a random variable representing the resampled $Y$ for the $i^{th}$ observation in a resampled dataset. Let's check if independence holds. As the number of resamples becomes large, we have (with some abuse of notation):
$$f_{Y^{*}_i}( y ) = N(0,1)$$
But, for all $i,j$ that map onto the same observation in the original dataset from which we resampled, the conditional distribution is degenerate because of the repeated observations and the continuous nature of $Y$:
$$f_{Y^{*}_i | Y^{*}_j}( y_i | y_j ) = 1\{y_i = y_j\} \ne f_{Y^{*}_i}( y_i )$$
So independence appears not to hold, and I would expect inference that assumes independence to be invalid (probably anticonservative).
However, simulations (with code below) indicate that in fact, in the exact situation described above, in fact we have exactly nominal Type I error.
So does independence hold in bootstrapped samples or not? If not, why doesn't nonindependence compromise inference as it usually does? Do I not even understand the definition of "independent observations"?
Edit
I found this great discussion of the definition of independent observations that supports what I came up with intuitively. Hence, my question still stands.
Simulation
library(doParallel)
# set the number of cores
registerDoParallel(cores=8)
sim.reps = 250
n=50
boot.reps = 500
res = as.data.frame( foreach( i = 1:sim.reps, .combine=rbind ) %dopar% {
# generate original data under H0 for a 1-sample t-test
y = rnorm(n)
pvals = c()
for (i in 1:boot.reps) {
# classical bootstrap
ids = sample(1:n, replace=TRUE)
y.star = y[ids]
# t-test
pvals[i] = t.test(y.star)$p.value
}
# should be 0.05
sum(pvals < 0.05) / length(pvals)
} )
names(res) = "rej"
res$rej = as.numeric(res$rej)
# equals 0.05
mean(res$rej)
References
Romano, J. P., & Wolf, M. (2007). Control of generalized error rates in multiple testing. The Annals of Statistics, 1378-1408.