Learn R Programming

rvgtest (version 0.7.2)

rvgt.Mtest: Perform M-Test on RVG Frequency Table

Description

Perform an adjusted residual test (M-Test) on the RVG frequency table.

Usage

rvgt.Mtest(ftable)

Arguments

ftable
object of class "rvgt.ftable".

Value

  • An object of class "rvgt.htest" which is a list with components:
  • typecharacter string containing type of test; equals "M-test".
  • nsample size for every row in ftable.
  • repnumber of rows in ftable.
  • breaksnumber of break points in ftable (i.e., number of bins + 1).
  • pvalvector of p-values.

Details

rvgt.Mtest performs an adjusted residual test (M-Test) on the bin counts of the RVG frequency tables created by means of rvgt.ftable. The null hypothesis is that the bin counts are distributed according to the expected probabilities (i.e., proportional to the lengths of the histogram cells).

If the ftable contains the bin counts for more than one repetitions then the test is repeated with column sums of increasing number of rows which corresponds to increasing sampling sizes. This allows for getting an idea of the power of the test.

References

C. Fuchs and R. Kenett. A test for Detecting Outlying Cells in the Multinomial Distribution and Two-Way Contingency Tables. Journal of American Statistical Association, Vol 75, June 1980, 395--398.

See Also

See plot.rvgt.htest for the syntax of the plotting method.

Examples

Run this code
## Create a frequency table for normal distribution and
## conduct an M-test on this data.
## Use a sample of size of 5 times 10^5 random variates.
table <- rvgt.ftable(n=1e5,rep=5, rdist=rnorm,qdist=qnorm, mean=1,sd=2)

## Perform test
result <- rvgt.Mtest(table)

## Plot result
plot(result)

Run the code above in your browser using DataLab