rmway.alt.only: Generate random K statistic values with rmway function's...

Description Usage Arguments Value Examples

View source: R/SphereKaji20140527.R

Description

Generate random K statistic values with rmway function's output reused

Usage

1
rmway.alt.only(alt.hx, odds.ratio.table, or, rmway.out, n.alt, K.alt)

Arguments

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

rmway.out

rmway function's output

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
 8
 9
10
11
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)
test.table <- matrix(c(1,0.5,0,0,0,0),byrow=TRUE,2,3)
odds.ratio.table <- matrix(c(1,0,2,3,0,4),byrow=TRUE,2,3)
or <- 2
rmway.alt.only(test.table,odds.ratio.table,or,rmway.out)

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