simulation [Nonparametrics]
dear HS and d_labes!
you may find the following simulation results interesting
best regards
martin
you may find the following simulation results interesting
rm(list=ls(all=TRUE))
library(coin)
library(exactRankTests)
set.seed(130910)
n <- 10
nsim <- 1E4
cover1 <- 0
cover2 <- 0
grp <- as.factor(c(rep('A', n), rep('B', n)))
for(i in 1:nsim){
x <- c(round(rnorm(n, mean=0, sd=1),1), round(rnorm(n, mean=0, sd=1),1))
res1 <- confint(wilcox_test(x~grp, distribution='exact', conf.int=TRUE,
conf.level=0.95))$conf.int
res2 <- wilcox.exact(x~grp, conf.int=TRUE, conf.level=0.95)$conf.int
if(res1[1] < 0 & res1[2] > 0){cover1 <- cover1 + 1}
if(res2[1] < 0 & res2[2] > 0){cover2 <- cover2 + 1}
}
print(cover1/nsim)
[1] 0.937
print(cover2/nsim)
[1] 0.9505
prop.test(x=c(cover1, cover2), n=c(nsim, nsim))
2-sample test for equality of proportions with continuity correction
data: c(cover1, cover2) out of c(nsim, nsim)
X-squared = 16.9122, df = 1, p-value = 3.915e-05
alternative hypothesis: two.sided
95 percent confidence interval:
-0.01998361 -0.00701639
sample estimates:
prop 1 prop 2
0.9370 0.9505
best regards
martin
Complete thread:
- tmax in case of ties: R vs. R vs. SAS d_labes 2010-09-10 12:05 [Nonparametrics]
- tmax in case of ties: StatXact, Phoenix, and... Helmut 2010-09-10 18:28
- Ties, no ties, ties, no ties ... d_labes 2010-09-13 13:21
- simulationmartin 2010-09-14 08:33
- simulants of the world unite d_labes 2010-09-15 10:14
- simulants of the world unite martin 2010-09-15 14:53
- simulants of the world unite Helmut 2010-09-15 16:17
- simul ants with no ties d_labes 2010-09-16 11:19
- simul ants with no ties Helmut 2010-09-16 14:01
- two different approaches martin 2010-09-16 15:35
- simul ants with no ties Helmut 2010-09-16 14:01
- simul ants with no ties d_labes 2010-09-16 11:19
- simulants of the world unite Helmut 2010-09-15 16:17
- simulants of the world unite martin 2010-09-15 14:53
- simulants of the world unite d_labes 2010-09-15 10:14
- simulationmartin 2010-09-14 08:33
- Ties, no ties, ties, no ties ... d_labes 2010-09-13 13:21
- evaluation of tmax: use of relative effects? martin 2010-09-16 18:04
- Not positive about that Helmut 2010-09-16 19:52
- Not positive about that martin 2010-09-16 21:00
- Stupidity Helmut 2010-09-17 13:10
- Not positive about that martin 2010-09-16 21:00
- Not positive about that Helmut 2010-09-16 19:52
- tmax in case of ties: R vs. R vs. SAS Jack 2010-09-20 14:03
- R packages Helmut 2010-09-20 14:20
- R packages code d_labes 2010-09-27 11:27
- R packages Jack 2010-09-27 16:14
- Is Exact exact? d_labes 2010-09-27 09:53
- R packages Helmut 2010-09-20 14:20
- tmax in case of ties: StatXact, Phoenix, and... Helmut 2010-09-10 18:28