Displaying 1 result from an estimated 1 matches for "whichrows".
Did you mean:
whichres
2007 Jan 26
1
bootstrap bca confidence intervals for large number of statistics in one model; library("boot")
...ree regression parameters and for the fitted
values at 50 levels of the predictor.
set.seed(1234567)
x<-runif(150)
y<-2/3 + pi * x^2 + runif(length(x))/2
plot(x,y)
DAT<-data.frame(x,y)
NEWDATA<-data.frame(x=seq(min(x), max(x), length=50))
library('boot')
myfn<-function(data, whichrows) {
TheseData<-data[whichrows,]
thisLM<-lm( y~poly(x,2), data=TheseData)
thisFit<-predict(thisLM, newdata=NEWDATA)
c(
coef(summary(thisLM))[,"Estimate"]
, thisFit)
}
bootObj<-boot( data=DAT, statistic=myfn, R=1000 )
names(bootObj)
dim(bootObj$t)
sofar<-t(sapply( 1:nc...