Description Usage Arguments Details Value See Also Examples
View source: R/contingency.tables.R
Applies and adds the Cochran-Mantel-Haenzsel test to a contingency.tables
object. The Cochran-Mantel-Haenzsel tests
the independence of two nominal variables, stratified by a third nominal variable, assuming no three way interaction.
1 | add.mantel.haenszel(tables,conservative=FALSE)
|
tables |
An object of class |
conservative |
Should a continuity 'correction' be applied |
This is a convenience function wrapping mantelhaen.test
in a add.cross.strata.test
call.
See mantelhaen.test
for further details.
A contingency.tables
object identical to tables
, but with the test applied to each table.
add.cross.strata.test
add.test
mantelhaen.test
1 2 3 4 5 6 7 | dat<-data.frame(a=rnorm(100)>.5,b=rnorm(100)>0,c=rnorm(100)>(-.5))
tables1<-contingency.tables(
row.vars=a,
col.vars=b,
stratum.var=c,data=dat)
tables1<-add.mantel.haenszel(tables1)
print(tables1,prop.r=TRUE,prop.c=TRUE,prop.t=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.