mult.bootstrap <- function(est.eff,sigma,ifvals,alpha, n,nbs){
eff.mat <- matrix(rep(est.eff,n), nrow = n, byrow = T)
sig.mat <- matrix(rep(sigma,n), nrow = n, byrow = T)
ifvals.std <- (ifvals - eff.mat)/sig.mat
mult <- matrix(2*rbinom(n*nbs, 1, .5)-1, nrow = n, ncol = nbs)
maxvals <- sapply(1:nbs, function(col){
max(abs(sum(mult[,col]*ifvals.std, na.rm = T)/sqrt(n)), na.rm = TRUE)
})
calpha <- quantile(maxvals, 1-alpha)
ll2 <- est.eff - calpha*sigma/sqrt(n)
ul2 <- est.eff + calpha*sigma/sqrt(n)
return(list(calpha = calpha, ll2 = ll2, ul2 = ul2))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.