[R-sig-eco] "average" regression - bootstrap?

Johannes Radinger JRadinger at gmx.at
Mon Aug 29 14:59:47 CEST 2011


Hello,

I've kind of a tricky statistical problem. First of all: I want to do a standard linear regression. Therefore my model is: 

X <- function()runif(length(Xa), Xa, Xb)
model <- lm(Y~X())

so X is a function drawing a random number between Xa and Xb (that is necessary in my case). What I did so far is:

example1 <- list()
n=1000
for(i in 1:n) {
	model <- lm(Y~X())
	example1[[paste("run",i,sep="")]] <- model
	}

So I ran the regression 1000 times and created a list with the regression parameters for each run.

How can I analyse these results now? I can get nice mean values for p, R-squared etc. but is that the right way?

So I thought, maybe a bootstrap approach can help in this case. Instead of doing the "manual" repeaded regression I can use bootstrap. But does the boot-function allow to use the "runif"-function for the X variable, so that each bootstrap run a new number is drawn? If it is the case it'd be nice because then I can get summarized results, a thing that I want. On the other hand, I don't necessarily need the subsampling of bootstrap. So in my case the subsample=all cases. Does that make sense?

Hopefully you can give me some inputs

best regards
Johannes


--



More information about the R-sig-ecology mailing list