I'm trying to make a loop which gives me back the bootstrapped confidence intervals for a regression analysis with one Intercept and three coefficients. Programming the bootstrapping function worked well.
The problem is that I have to adress each object of the regression within the function boot.ci with an index (like index=1), because boot.ci doesn't know the names of my regression model coefficients.
So I did the following:
for (i in 2:inputnumberobjects)
{
cat(paste("BOOT CONFIDENCE INTERVALS FOR COEFFICIENT ", inputnamesobjects[i], ":\n\n", sep=""))
boot.ci(bootResults, type = "bca", index=i) ### Result for Coefficients
}
Before the loop I spefified the number of objects and the names of the objects.
The problem is, that the function somehow seems to ignore the boot.ci Function within the loop.
For example if the names of the objects are inputnamesobjects <- c("a", "b", "c", "d")
then I get the following output:
BOOT CONFIDENCE INTERVALS FOR COEFFICIENT a:
BOOT CONFIDENCE INTERVALS FOR COEFFICIENT b:
BOOT CONFIDENCE INTERVALS FOR COEFFICIENT c:
BOOT CONFIDENCE INTERVALS FOR COEFFICIENT d:
What I didn't get, is the results of boot.ci
If I#m not using a loop and instead use something like:
boot.ci(bootResults, type = "bca", index=2)
everything works fine.
Any ideas?