Learn R Programming

CramTest (version 1.5)

TestStatExpectation: Expectation of Cramer test statistics

Description

Calculates the expectation of the test statistics calculated using the Cramer test.

Usage

TestStatExpectation(sample, Regions)

Arguments

sample

a (non-empty) numeric vector of data values.

Regions

a (non-empty) numeric vector of grid points to be used in the integration.

Details

sample should be the two samples of data that is to be tested using the Cramer test, concatinated.

Regions must be sorted from smallest to largest number. Regions must not contain any numbers smaller than the minimum value or larger than the maximum value of sample.

The result is more accurate when more grid points are used, however the use of more grid points could make the function run slower. It is recommended to use equally spaced grid points.

Examples

Run this code
# NOT RUN {
	data1 = rnorm(100)
	data2 = rnorm(100)
	data = c(data1, data2)
	regions = seq(min(data), max(data), length = 50)
	TestStatExpectation(data, regions)
# }

Run the code above in your browser using DataLab