This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?cochran.qtest #after hitting 'Enter/Return' there should be | |
#another window to open for documentation or | |
#it will open on your default browser, | |
#depending on how you install R. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
results <- c(1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,0,1,1,0,1,1,1,0,1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
results <- c(1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,0,1,1,0,1,1,1,0,1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
length(results) #if the output is 24 then you haven't miss | |
#any data to input. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
methods <- factor(rep(LETTERS[1:4],6)) | |
fabrics <- factor(rep(letters[1:6],each = 4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tapply(results, list(fabrics,methods), sum) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A B C D | |
a 1 1 0 0 | |
b 1 1 0 1 | |
c 1 0 0 0 | |
d 1 1 1 0 | |
e 1 1 0 1 | |
f 1 1 0 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cochran.qtest(results~methods|fabrics) | |
Cochran Q test | |
results ~ methods , block = fabrics | |
Q df p.value signif | |
9.3158 3 0.025374 * | |
Pairwise comparisons by Wilcoxon sign test - correction: fdr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t.test(drug, placebo, alternative = "less", var.equal = F) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drug <-c(15,10,13,7,9,8,21,9,14,8) | |
placebo <-c(15,14,12,8,14,7,16,10,15,12) | |
t.test(drug, placebo, alternative = "less", var.equal = T) |