Hu, Zidek and Kalbfleisch linear regression bootstrap library(bootstrap) data(cell) ffit=lm(log.surv~dose+I(dose^2),data=cell) ffit #Call: #lm(formula = log.surv ~ dose + I(dose^2), data = cell) # #Coefficients: #(Intercept) dose I(dose^2) # 1.26911 -1.40242 0.05416 names(ffit) #[1] "coefficients" "residuals" "effects" "rank" #[5] "fitted.values" "assign" "qr" "df.residual" #[9] "xlevels" "call" "terms" "model" myresid=ffit$resid sum(myresid) #[1] -4.024558e-16 ### should be zero xmat=as.matrix(ffit$model) xmat[,1]=1 xmat # log.surv dose I(dose^2) #1 1 1.175 1.380625 #2 1 1.175 1.380625 #3 1 2.350 5.522500 #4 1 2.350 5.522500 #5 1 4.700 22.090000 #6 1 4.700 22.090000 #7 1 4.700 22.090000 #8 1 7.050 49.702500 #9 1 7.050 49.702500 #10 1 9.400 88.360000 #11 1 9.400 88.360000 #12 1 9.400 88.360000 #13 1 14.100 198.810000 #14 1 14.100 198.810000 xtxinv=solve(t(xmat)%*%xmat) zmat=xmat*myresid n=1000 output=matrix(0,ncol=3,nrow=n) for (i in 1:n) { k.star=sample(1:14,size=14,replace=TRUE) szstar=colSums(zmat[k.star,]) output[i,]=xtxinv%*%szstar } output[1:10,] # [,1] [,2] [,3] #[1,] -0.3271456 0.28759741 -0.023883144 #[2,] -0.7978400 0.36638753 -0.025507206 #[3,] -0.3781951 0.21880334 -0.020112902 #[4,] 0.0589859 0.11459679 -0.020461785 #[5,] -0.6772981 0.23360651 -0.016703131 #[6,] 1.4241394 -0.71322810 0.067530879 #[7,] -0.1868855 0.01149351 0.002674990 #[8,] 0.4019711 -0.04870342 -0.006039779 #[9,] 0.7026226 -0.27483582 0.008215798 #[10,] -0.7730005 0.03410025 0.011512503 covmat=var(output) c(covmat[1,1],covmat[2,2],covmat[3,3])^0.5 #[1] 0.5511719 0.2778584 0.0237509 summary(ffit) # #lm(formula = log.surv ~ dose + I(dose^2), data = cell) # #Residuals: # Min 1Q Median 3Q Max #-1.98443 -0.46592 0.03765 0.54980 2.77457 # #Coefficients: # Estimate Std. Error t value Pr(>|t|) #(Intercept) 1.26911 1.05542 1.202 0.25443 #dose -1.40242 0.33260 -4.217 0.00144 ** #I(dose^2) 0.05416 0.02144 2.526 0.02816 * #--- #Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 # #Residual standard error: 1.353 on 11 degrees of freedom #Multiple R-Squared: 0.8271, Adjusted R-squared: 0.7957 #F-statistic: 26.32 on 2 and 11 DF, p-value: 6.415e-05 We see that the estimated standard errors are similar, particularly for beta2, the coef for I(dose^2). They are less similar for intercept.