linear.trend: Linear Trend Test

Description Usage Arguments Value Examples

Description

This function performs a Mantel Haenszel Chi-Square Test for Two Way Tables.

Usage

1
linear.trend(x, row.scores = NULL, col.scores = NULL)

Arguments

x

A contingency table of structure matrix, or factor (the latter being passed through as table())

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

Value

The M^2 test statistic, the parameters for the test (r and df), the type of test performed, and the resultant p-value.

Examples

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))

ESunRoc/STT218 documentation built on Jan. 14, 2020, 2:39 a.m.