tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
8
Task/Permutation-test/R/permutation-test-1.r
Normal file
8
Task/Permutation-test/R/permutation-test-1.r
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
permutation.test <- function(treatment, control) {
|
||||
perms <- combinations(length(treatment)+length(control),
|
||||
length(treatment),
|
||||
c(treatment, control),
|
||||
set=FALSE)
|
||||
p <- mean(rowMeans(perms) <= mean(treatment))
|
||||
c(under=p, over=(1-p))
|
||||
}
|
||||
4
Task/Permutation-test/R/permutation-test-2.r
Normal file
4
Task/Permutation-test/R/permutation-test-2.r
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
> permutation.test(c(85, 88, 75, 66, 25, 29, 83, 39, 97),
|
||||
+ c(68, 41, 10, 49, 16, 65, 32, 92, 28, 98))
|
||||
under over
|
||||
0.8719717 0.1280283
|
||||
Loading…
Add table
Add a link
Reference in a new issue