Andreas Klein wrote:
Hello.


How can I compute the Bootstrap p-Value for a one- and two sided test, when I 
have a bootstrap sample of a statistic of 1000 for example?

My hypothesis are for example:

1. Two-Sided: H0: mean=0 vs. H1: mean!=0
2. One Sided: H0: mean>=0 vs. H1: mean<0

hi,
do you want to test your original t.test against t.tests of bootstrapped samples from you data?

if so, you can just write a function creating a vector with the statistics (t) of the single t.tests (in your case 1000 t.tests each with a bootstrapped sample of your original data -> 1000 simulated t-values).
you extract them by:

> tvalue=t.test(a~factor)$statistic

then just calculate the proportion of t-values from you bootstrapped tests that are bigger than your original t-value.

>p=sum(simualted_tvalue>original_tvalue)/1000


(or did I get the question wrong?)

cheers,
gregor

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to