[R] bootstraping lm

Ernesto Jardim ernesto at ipimar.pt
Thu Jan 16 13:43:02 CET 2003


I'm doing a bootstrap of a linear model using:

boot.fishpower <- function(data, i){

	data <- data[i,]
	fplm <- lm(log(U)~Q+S+P+B+D, data=data)
	fp <- coef(fplm)

> boot(logglm.data,boot.fishpower,100)
Error in "[<-"(*tmp*, r, , value = statistic(data, i[r, ], ...)) : 
        number of items to replace is not a multiple of replacement

I've used debug to look at the process and it seems ok. The "i" are
allways of the same length as the dataframe rows. And it loops for a
while, but at some point it stops and gives this error ... 

Can someone help me with this ?



Ernesto Jardim <ernesto at ipimar.pt>
Marine Biologist
Research Institute for Agriculture and Fisheries
Lisboa, Portugal
Tel: +351 213 027 000
Fax: +351 213 015 948

More information about the R-help mailing list