Thank you for the suggestion. Is there a function for doing that in R? David
On 3/7/2014 9:50 AM, Therneau, Terry M., Ph.D. wrote:
With respect to question 2, I use the wild bootstrap for tau. Wu, C.F.J. (1986). Jackknife, bootstrap and other resampling methods in regression analysis (with discussions). Annals of Statistics, 14, 1261-1350. -- begin included message ---------- I want to bootstrap Kendall's tau correlation with data that have many NAs. I tried this example: x <- 1:15 y <- c(2,4,1,3,5, 7,6, 9,10,8, 14, 13, 11, 15, 12) x[3] <- NA; x[11] <- NA; x[8] <- NA y[2] <- NA; y[8] <- NA; y[12] <- NA cor(x,y,use="complete.obs",method="kendall") library(boot) tmpdf <- data.frame(x,y) corboot <- boot(tmpdf, cor(x,y,use="complete.obs",method="kendall"), R=999) When I run that, I get this error: Error in boot(tmpdf, cor(x, y, use = "complete.obs", method = "kendall"), : could not find function "statistic" So my first question is, how do I tell boot that I want to use cor with those options to produce the statistic to be bootstrapped? A second question is this. My real data have lots of ties, in both the x and y variables, so I want to jitter the data before calculating tau. Is there a way to jitter x and y at each of the bootstrap calls, as I would do for the call with the original data. How would I specify that action?
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.