
library(foreign)
x <- read.spss("U:\\My Documents\\beck.sav")
#x <- read.spss("E:\\EDA FOR ZIPPING\\DEMO EDA DATA\\beck.sav")
x1 <- data.frame(x)

#n <- 15
nb<-1000
boot<-matrix(NA,nb,3)
attributes(boot)

wilcox.test(x1$beck ~ x1$sex)
# W = 432582

for (i in 1:nb)
{
bs<-sample(x1$sex,replace =F)
out <- wilcox.test(x1$beck ~ bs)
boot[i,1]<- out$statistic
}
hist(boot[,1])
# 432582 is very extreme fitting in with the given asymptotic p-value of 2.108e-07


