search for: npboot

Displaying 1 result from an estimated 1 matches for "npboot".

Did you mean: nboot
2007 Nov 01
1
loops & sampling
...<- c(5.0,14.6, 8.9, 9.0, 9.1, 5.5) #join abc <- data.frame(a,b,c) #set column names names(abc)[1]<-"y" names(abc)[2]<-"x1" names(abc)[3]<-"x2" abc2 <- abc #sample abc3 <- as.data.frame(t(as.matrix(data.frame(abc2)))) n <- length(abc2) npboot.function <- function(nboot) { boot.cor <- vector(length=nboot) for(i in 1:nboot){ rdata <- sample(abc3,n,replace=T) abc4 <- as.data.frame(t(as.matrix(data.frame(rdata)))) model <- lm(asin(sqrt(abc4$y/100)) ~ I(abc4$x1^2) + abc4$x2) boot.cor[i] <- cor(abc4$y, model$fit)} bo...