Learn R Programming

RVAideMemoire (version 0.9-6)

cochran.qtest: Cochran Q test

Description

Perform the Cochran Q test for unreplicated randomized block design experiments whith a binary response variable and paired data. If the p-value of the test is significative, the function performs pairwise comparisons using Wilcoxon sign test.

Usage

cochran.qtest(resp, fact, block, alpha = 0.05, p.method = "fdr")

Arguments

resp
response variable (binary vector).
fact
factor.
block
factor for blocks of paired data (random factor).
alpha
significance level to compute pairwise comparisons.
p.method
method for p-values correction. See help of the p.adjust() function.

Value

  • datavariables name.
  • alphasignificance level.
  • Qtest statistics.
  • p.valuep-value of the global test.
  • tab.testdata.frame of global test result
  • p.methodmethod for p-values correction.
  • p.multcompcorrected p-values
  • multcompdata.frame of pairwise comparisons result.

Examples

Run this code
response<-c(0,1,1,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,0,1,1,0,0,1,0,1,1,0,0,1)
factor<-factor(rep(LETTERS[1:3],10))
block<-factor(rep(letters[1:10],each=3))
cochran.qtest(response,factor,block)

Run the code above in your browser using DataLab