I am successful in bootstrapping my data set but I am having trouble iterating the output of the function.
here is my code:
anova_one_run = function () {
size_n = dim(dat)[1]
dat_boot <- sample_n(dat, size_n, replace = TRUE) #random sample with replacement
dim(dat_boot)
anova_out <- aov(outcome ~ var1*var2 + (1/(id)), data = dat_boot)
anova_out=TukeyHSD(anova_out)
#iterate bootstrap; here is the issue...
anova_simulate = as.data.frame(t(replicate(100, anova_one_run)))
When I iterate the data I get the function 100 times but not the output. I am looking to get 100 different outputs, i.e. the output for 100 random bootstrap samples with replacement.