Johannes, You are doing what many folks call the parametric bootstrap. The bootstrap that resamples the data is the non-parametric bootstrap. Often it is easier to code by hand, as you have done. If you want access to all the helper functions for the bootstrap, you can use boot() in the boot library and specify sim='parametric'. The details of your random uniform distribution go in the function specified in the ran.gen= argument. Once you've generated the bootstrap samples (parametric or nonparametric), there is no difference in subsequent processing. Best wishes, Philip Dixon
Average Regression and the bootstrap
2 messages · Dixon, Philip M [STAT], Johannes Radinger
Hej again,
thank you that I know now that this is called parametric bootstrap.
I am very unsure if I am doing right. So I tried to write a bootstrap
script which is now as follows:
data <- data.frame(Y,X1a,X1b,X2)
X1.gen <- function()
{
X1 <- function()runif(length(X1a), X1a, X1b)
}
statistic <- function()
{
X1 <- function()runif(length(X1a), X1a, X1b)
model <- lm(Y~X1())
}
regression.boot <- boot(data, statistic, R=1000, sim="parametric", ran.gen=X1.gen)
It is somehow incomplete...not sure how to proceed, as I am really new to bootstrap and R. Maybe I am doing totally wrong... not sure at all.
Just to get it clear to me: Bootstrap resamples from the finite dataset with the "dynamic" X1 (170 cases in my example) and during each sampling a new X1 is calculated (runif) for the case?
Maybe someone can help me here...
thanks to you all
Johannes
-------- Original-Nachricht --------
Datum: Tue, 30 Aug 2011 07:00:44 -0500 Von: "Dixon, Philip M [STAT]" <pdixon at iastate.edu> An: "r-sig-ecology at r-project.org" <r-sig-ecology at r-project.org> Betreff: [R-sig-eco] Average Regression and the bootstrap
Johannes, You are doing what many folks call the parametric bootstrap. The bootstrap that resamples the data is the non-parametric bootstrap. Often it is easier to code by hand, as you have done. If you want access to all the helper functions for the bootstrap, you can use boot() in the boot library and specify sim='parametric'. The details of your random uniform distribution go in the function specified in the ran.gen= argument. Once you've generated the bootstrap samples (parametric or nonparametric), there is no difference in subsequent processing. Best wishes, Philip Dixon
_______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
--