You can generate a vector with 1,000 random integers from [0, 20] using the following code:
31 chars2 lines
To apply the nonparametric bootstrap algorithm with 999 replications to estimate the standard deviation of the mean of the vector, you can use the following code:
458 chars12 lines
Note that the datasample
function is used to sample with replacement from the original sample to create the bootstrap sample. The mean of each bootstrap sample is stored in the means
vector, which is used to compute the standard deviation of the means using the std
function.
gistlibby LogSnag