rmway: Generate random K statistic values

Description Usage Arguments Value Examples

View source: R/SphereKaji20140527.R

Description

Generate random K statistic values

Usage

1
rmway(n, A, tests, alt.hx, odds.ratio.table, or, n.alt, K.alt)

Arguments

n

Number of random unit vectors

A

An array or matrix of a table

tests

A list of test tables

alt.hx

A matrix or array of a table which indicates the direction of alternative hypothesis along with an argument odds.ratio.table

odds.ratio.table

A matrix or array of a table with cell values being 0,1,2,3 or 4: Odds ratio of table is indicated by the (sum(cells of 1)*sum(cells of 4))/(sum(cells of 2)*sum(cells of 3))

or

A number indicating odds ratio defined by odds.ratio.table argument

n.alt

Optional. An integer which makes a one-dimensional grid with n points, among which the table with odds ratio closest to the argument or is selected

K.alt

Optional. A number indicating the maximum value of square of chi-square value to search the table of alternative hypothsis

Value

Examples

1
2
3
4
5
6
7
A <- matrix(c(10,20,30,40,50,60),2,3)
t1 <- t2 <- t3 <- matrix(c(1,0,0,0,0,0),byrow=TRUE,2,3)
t2[1,2] <- 0.5
t3[1,2] <- 1
tests <- list(t1,t2,t3)
n <- 1000
rmway.out <- rmway(n,A,tests)

ryamada22/mwaytable documentation built on May 28, 2019, 10:44 a.m.