Consider an experiment with $m$ subjects and $n$ words. Every subject rates every word, producing an $(m \times n)$ data matrix $\hat{X}$. I am interested in forming a confidence interval around $f(\hat{X})$ where $f$ is some arbitrary scalar function. I'd like this confidence interval to take into account both the sampling error that comes from the random choice of subjects and the sampling error that comes from the random choice of the words.
What I'm inclined to do is to bootstrap both subjects and words: On each bootstrap iteration, randomly resample the words (with replacement) and the same for subjects (using the same set of resampled words for all resampled subjects). This generates a resampled data matrix $X^\ast_i$, and a bootstrap estimate $f(X^\ast_i)$. The vector of bootstrap estimates (e.g., 10,000 of them) is then used to form a bootstrap confidence interval (e.g., percentile bootstrap) as if these estimates were standard, single-factor bootstrap estimates.
- Is this legit or am I violating some implicit assumption of the bootstrap?
- Is there a more principled way of dealing with this problem?
- Is there any R package that implements such a procedure? I can easily write the resampling code but calculating advanced bootstrap intervals (e.g., BCa) isn't trivial.
boot
seems to assume a single random effect.