The test determines the total strength of association in multiple contingency tables.
strength.test(tables)
a list of at least two non-negative matrices or data frames representing contingency tables.
A list with class "htest
" containing the following components:
the strength test statistic.
the degrees of freedom of null chi-squared distribution.
the p-value for the test, computed using the null chi-squared distribution.
The strength test determines total amount of association in multiple input contingency tables. Its test statistic asymptotically follows the chi-squared distribution under the null hypothesis of each table having independent row and column variables sharma2020COPTYPDiffXTables.
The test statistic is minimized to zero if and only if row and column variables are empirically independent of each other in every table.
This test is considered a zeroth-order test in the function type.analysis
that characterizes the difference across multiple contingency tables.
A second-order different test sharma.song.test
. A first-order difference test marginal.change.test
. The comparative type of differences across contingency tables type.analysis
.
# NOT RUN {
# Both tables have strong association:
tables <- list(
matrix(c(30,0,0,
0,10,0,
0,0,20), nrow=3),
matrix(c(10,0,0,
0,20,0,
0,0,30), nrow=3)
)
strength.test(tables)
# One table has strong association:
tables <- list(
matrix(c(4,0,0,
0,4,0,
0,0,4), nrow=3),
matrix(c(4,0,4,
8,4,8,
4,0,4), nrow=3)
)
strength.test(tables)
# Both tables has no association:
tables <- list(
matrix(c(4,0,4,
8,4,8,
4,0,4), nrow=3),
matrix(c(4,0,4,
8,4,8,
4,0,4), nrow=3)
)
strength.test(tables)
# }
Run the code above in your browser using DataLab