I want to be able to generate some confidence intervals for some test statistics using bootstrapping. What I would like to be able to do is to draw a bootstrapped dataset using sampling with replacement from my original dataset. I'm assuming that this would be a dataset of size n (where n is smaller than the size of the original dataset) that samples observations/rows of data from the full dataset with replacement (so that some rows may be drawn twice).
The code I have now for a single iteration is the following:
samp <- dat[sample(nrow(dat), 100000), ]
This code samples 100k rows from my dataset (dat).
My questions are the following:
Is this code sampling the rows with replacement? And is my assumption correct: a bootstrapped dataset using sampling with replacement is equivalent to sampling a dataset of size n (smaller than the original dataset) that randomly draws rows of data from the full dataset with replacement (is this bootstrapping with replacement)?