From: Matt Oliver <matt.j.oliver_at_gmail.com>

Date: Sat 21 May 2005 - 05:46:56 EST

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat May 21 05:50:22 2005

Date: Sat 21 May 2005 - 05:46:56 EST

*> x <- runif(20)
**>
**> y <- c(runif(19), NA)
**>
*

> median(x)

[1] 0.522284

*>
*

> median(y[1:19])

[1] 0.488046

*>
*

> median(x)/median((y)[1:19])

[1] 1.070153

*>
**> t <- as.data.frame(cbind(x, y))
**>
**> ratio <- function(t, i) median(t$x[i])/median((t$y[1:19])[i])
**>
*

> boot(t, ratio, R = 1000)

**ORDINARY NONPARAMETRIC BOOTSTRAP
**
Call:

boot(data = t, statistic = ratio, R = 1000)

Bootstrap Statistics :

original bias std. error

t1* NA NA 0.4603294

*> x <- runif(20)
**>
**> y <- runif(19)
**>
*

> median(x)

[1] 0.732906

*>
*

> median(y)

[1] 0.5596225

*>
*

> median(x)/median(y)

[1] 1.309644

*>
**> t <- list(x = x, y = y)
**>
**> ratio <- function(t, i) median(t$x[i])/median(t$y[i])
**>
*

> boot(t, ratio, R = 1000)

**ORDINARY NONPARAMETRIC BOOTSTRAP
**
Call:

boot(data = t, statistic = ratio, R = 1000)

Bootstrap Statistics :

original bias std. error

t1* 1.153598 -0.004907764 0.08266257

Is there a way to do this type of bootstrap with the boot() function?

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat May 21 05:50:22 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:31:59 EST
*