cochrans.q: Cochran's Q Test

Description Usage Arguments Value Author(s) References Examples

View source: R/cochrans.q.R

Description

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.

Usage

1
  cochrans.q(x, alpha=NULL)

Arguments

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.

Value

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.

Author(s)

D. Lukke Sweet

References

https://www.r-bloggers.com/cochran-q-test-for-k-related-samples-in-r/

http://rcompanion.org/handbook/H_07.html

Examples

 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)

nonpar documentation built on April 29, 2020, 9:36 a.m.

Related to cochrans.q in nonpar...