According to Bradley & Efron if you want to estimate the standard error $se(\hat\theta)$ by the sample standard deviation of the $B$ replications you will take $$\hat{se}_{B} = \sum_{b=1}^{B}\left([\hat\theta^{\star}(b)-\hat\theta^{\star}(\cdot)]^2 / (B-1)\right)^{1/2}$$
where $\hat\theta^{\star}(\cdot) =\sum_{b=1}^{B}\hat\theta^{\star}(b)/B $
Doing so in R :
#Regression Data
#===============
n <- 27
x <- c(99, 152, 293, 155, 196, 53, 184, 171, 52, 376, 385, 402, 29, 76, 296, 151, 177, 209, 119, 188, 115, 88, 58, 49, 150, 107, 125)
y <- c(25.8, 20.5, 14.3, 23.2, 20.6, 31.1, 20.9, 20.9, 30.4, 16.3, 11.6, 11.8, 32.5, 32.0, 18.0, 24.1, 26.5, 25.8, 28.8, 22.0, 29.7, 28.9, 32.8, 32.5, 25.4, 31.7, 28.5)
#OLS Regression estimates
#========================
ones <- rep(1,n)
DM <- cbind(ones,x)
betas.OLS <- solve(t(DM)%*%DM)%*%t(DM)%*%y
betas.OLS
ehat.OLS <- y-DM%*%betas.OLS
ehat.OLS
sigma2.hat <- t(ehat.OLS)%*%ehat.OLS/(n-2)
sigma2.hat
sigma.hat <- sqrt(sigma2.hat)
sigma.hat
var.betas.OLS <- drop(sigma2.hat)*solve(t(DM)%*%DM)
var.betas.OLS
std.betas.OLS <- sqrt(diag(var.betas.OLS))
std.betas.OLS
betas.OLS
std.betas.OLS
#Nonparametric Bootstrap
#=======================
B<-10000
sample.betas<-NULL
for (i in 1:B)
{
Boot.residual.sample <- sample(ehat.OLS,size=n,replace=T)
Y.sample <- DM%*%betas.OLS+Boot.residual.sample
Boot.betas <- solve(t(DM)%*%DM)%*%t(DM)%*%Y.sample
sample.betas <- cbind(sample.betas,Boot.betas)
}
sampling.mean <- apply(sample.betas,1,mean)
sampling.mean
sampling.var <- apply(sample.betas,1,var)
sampling.s.e <- sqrt(sampling.var)
sampling.s.e
#Parametric Bootstrap
#====================
B<-10000
sample.betas<-NULL
for (i in 1:B)
{
Boot.residual.sample <- rnorm(n,0,sigma.hat)
Y.sample <- DM%*%betas.OLS+Boot.residual.sample
Boot.betas <- solve(t(DM)%*%DM)%*%t(DM)%*%Y.sample
sample.betas <- cbind(sample.betas,Boot.betas)
}
sampling.mean <- apply(sample.betas,1,mean)
sampling.mean
sampling.var <- apply(sample.betas,1,var)
sampling.s.e <- sqrt(sampling.var)
sampling.s.e
```