Hey guys,
I cant figure out what is wrong with this function and why my bootstrap code won't work, please help!
#create test statistic function
test_stat <- function(data, index) {
d <- data[index,]
t_s <- ((0.75*(mean(d)))+(0.15sqrt((1/499)(sum((d-mean(d))^2))))+(0.1*(quantile(d, 0.8))))
return(t_s)
}
#Bootstrapping
boot_return <- boot(data = SMM048_data_cw1$dataset4, statistic = test_stat, R = 500)
boot_return
boot.ci(boot_return)