Description Usage Arguments Value Author(s) References Examples
This function will perform the Cochran's Q Test to test for identical treatment effects in a two-way randomized block design with k treatments.
1 | cochrans.q(x, alpha=NULL)
|
x |
A b x k matrix, where b is the number of blocking factors and k is the number of treatment factors. |
alpha |
The Significance level, defaults to 0.05. |
Q |
This is the Cochran's Q Test Statistic. |
Degrees of Freedom |
The number of degrees of freedom used in calculating the p-value. |
Significance Level |
Returns the alpha value. |
P-value |
Returns the p-value from the Cochran's Q Test. |
D. Lukke Sweet
https://www.r-bloggers.com/cochran-q-test-for-k-related-samples-in-r/
http://rcompanion.org/handbook/H_07.html
1 2 3 4 5 6 7 8 9 10 11 | ## Run Cochran's Q Test on a matrix.
cochrans.q(matrix(c(1,1,1,1,1,1,
1,1,0,1,1,1,
0,0,0,1,0,0,
0,1,0,0,1,1), 6, 4))
## Cochran's Q Test works for any size matrix.
cochrans.q(matrix(c(0,1,0,0,1,0,0,0,1,0,0,0,0,0,
0,1,1,1,1,1,1,1,0,1,1,1,1,1,
0,1,0,0,0,0,0,0,1,0,0,0,0,0,
0,1,1,0,0,1,1,0,0,0,0,1,0,1), 14, 4), alpha=0.01)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.