gen.decision: gen.decision function This function compares frequency...

Description Usage Arguments Details Value References Examples

View source: R/Main.R

Description

gen.decision function This function compares frequency comparison counts of subsamples from two independent samples, and calculates a simulated p-value with a novel bootstrap method proposed in the reference paper.

Usage

1
2
gen.decision(est.prob, effn.subsam1, effn.subsam2, fn.rep = 10^3,
  alpha = 0.05)

Arguments

est.prob

a matrix of two rows, with each row represents the the sequential comparison results of subsamples from a sample.

effn.subsam1

the subsample sizes from sample 1.

effn.subsam2

the subsample sizes from sample 2.

fn.rep

the total number of replications.

alpha

the size of type I error.

Details

The dimensions of est.prob, effn.subsam1 and effn.subsam2 need to match. For example, the first two entries of the first two rows from est.prob are pf comparison results from subsample1 and subsample2 of sample1. Thus the sum of the two entries is the product of the two subsample sizes.

Value

critical.value the critical value of the test based on the alpha level provided

chi-stat the chisqure type test statistics value from the sample provided.

pvalue the simulated p-value.

References

Wang, Y., Stapleton, A. E., & Chen, C. (2018). Two-sample nonparametric stochastic order inference with an application in plant physiology. Journal of Statistical Computation and Simulation, 88(14), 2668-2683.

Examples

1
2
3
4
5
6
7
8
freq.mat<-rbind(c(20,5,10,15,20,5),c(15,10,15,10,20,5));
n.sam1<-rep(5,4);n.sam2<-rep(5,4); n.rep=1000;
gen.decision(freq.mat,n.sam1,n.sam2,n.rep);
### This command will replicate the first p-value in Table 4 of the reference paper.
freq.mat<-rbind(c(40,10,20,30,40,10),c(30,20,30,20,40,10));
n.sam1<-c(5,10,5,10);n.sam2<-c(10,5,10,5); n.rep=1000;
gen.decision(freq.mat,n.sam1,n.sam2,n.rep)
### This command will replicate the second p-value in Table 4 of the reference paper.

Trendtwosub documentation built on Feb. 9, 2021, 1:06 a.m.