Description Usage Arguments Value Examples
This function performs a Mantel Haenszel Chi-Square Test for Two Way Tables.
| 1 | linear.trend(x, row.scores = NULL, col.scores = NULL)
 | 
| x | A contingency table of structure matrix,
or factor (the latter being passed through as  | 
| row.scores | Numerical value assigned to rows for calculation purposes; Defaults to Null | 
| col.scores | Numerical value assigned to columns for calculation purposes; Defaults to Null | 
The M^2 test statistic, the parameters for the test (r and df), the type of test performed, and the resultant p-value.
| 1 2 3 4 5 6 | # create some table (for the purposes of this example, a 4x4)
table <- matrix(c(1.3.10,6,2,3,10,7,1,6,14,12,0,1,9,11), nrow=4, ncol=4, byrow=TRUE)
# pass the table directly through linear.trend if the table has already been given scores
linear.trend(table)
# change the default arguments in linear.trend to apply scores as needed
linear.trend(table, row.scores=c(10000,20000,30000,40000), col.scores = c(-2,-1,1,2))
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.