# [R] boot: how is t0 calculated?

David Winsemius dwinsemius at comcast.net
Tue Oct 23 07:15:31 CEST 2012

```On Oct 22, 2012, at 3:28 PM, Thomas Hoffmann wrote:

> Dear all,
>
> I am doing log-transformed bootstrap regression using:
>
> x=c(0.038,0.054,1.030,1.250,10.240,52.000,228.100,240.000,758.000,1502.600,0.140,9.170,280.000,1.000,0.150,0.388,20)
> y=c(3961.5,25987.5,526557,321094.5,6433332,23592715.5,40500000,
> 228853521.1,320980392,429000000,58435.5,13525240.5,621195600,1020000,30567.0,296100.0,4800000)
>
> xy = data.frame(x=x,y=y)
>
> reg.ln = function(storage, indices){
>  storage = storage[indices,]
>  res.lm  = lm(log(y)~log(x), data=storage)
>  coefficients(res.lm)
> }
>
> xy.boot = boot(xy, reg.ln, 2000)
>
>
>
> Why does the Intercept given by xy.boot\$t0 differs from mean(co.boot\$t[,1])?

Hard to tell from this perspective:

> mean(co.boot\$t[,1])
Error in mean(co.boot\$t[, 1]) :
error in evaluating the argument 'x' in selecting a method for function 'mean': Error: object 'co.boot' not found

Are you asking why 12.95 is not equal to 12.94?

> mean(xy.boot\$t[,1])
[1] 12.95764
> lm(log(y)~log(x), data=xy)

Call:
lm(formula = log(y) ~ log(x), data = xy)

Coefficients:
(Intercept)       log(x)
12.942        1.055

> How are the t0 values calculated?

t0?

> Any help is appreciated!

That is what some of us are thinking, too.

--

David Winsemius, MD
Alameda, CA, USA

```