flexorhtest {GeneF}R Documentation

A Flexible Order Restricted Hypothesis Testing

Description

These functions test the hypothesis regarding population means from ordered sample groups. Restrictions like a weakly/general/strongly isotonic/monotonic order as well as a lower bound for the location can be imposed on the population means. A partition of sample groups and the corresponding estimates of population means are also provided.

Usage

flexisoreg(y, x, lambda = 0, alpha.location = 1, alpha.adjacency = 0.5)
flexisoreg.stat(y, x, lambda = 0, alpha.location = 1, alpha.adjacency = 0.5)
flexmonoreg(y, x, lambda = 0, alpha.location = 1, alpha.adjacency = 0.5)
flexmonoreg.stat(y, x, lambda = 0, alpha.location = 1, alpha.adjacency = 0.5)

Arguments

y

a vector of observed data

x

a vector of ordinal group labels correponding to y but not necessarily sorted

lambda

a lower location bound for partitioned groups other than the first one

alpha.location

\alpha level for the upper-tailed one-sample t-test with lower bound lambda

alpha.adjacency

\alpha level for the upper-tailed two-sample t-test to evaluate the magnitude of nondecreasing order

Details

flexisoreg is used for flexible nondecreasing order restricted hypothesis testing. flexmonoreg is used for flexible nondecreasing or nonincreasing order restricted hypothesis testing. flexisoreg.stat and flexmonoreg.stat only return an F-statistic, which is convenient for multiple comparison.

Value

groups

A partition of sample groups

estimates

estimated population means

statistic

an F-type statistic from the test

Note

Since the p-value of test has to be evaluated by permutation method, these functions will not return any p-value. For the permutation p-value of an individual test, see flexisoreg.pvalue and flexmonoreg.pvalue. For the pooled permutation p-values of multiple tests, see flexisoreg.poolpvalues and flexmonoreg.poolpvalues.

Author(s)

Yinglei Lai ylai@gwu.edu

References

Yinglei Lai (2007) A flexible order restricted hypothesis testing and its application to gene expression data. Technical Report

Examples

#generate ordinal group lables x
x <- runif(100)*6
x <- round(x,0)/3
#generate true values z
z <- round(x^2,0)
#generate observed values y
y <- z + rnorm(100)


#print default results
print(rbind(x,z,y))
print(flexisoreg(y,x))
print(flexisoreg.stat(y,x))
print(flexisoreg(y,0-x))
print(flexisoreg.stat(y,0-x))
print(flexmonoreg(y,x))
print(flexmonoreg.stat(y,x))


     #plots for illustration
     par(mfrow=c(2,3), mai=c(0.6, 0.6, 0.3, 0.1))
     plot(x,y, main="True Model",cex.axis=1.5, cex.lab=1.5, cex.main=1.5, cex=1.5)
     lines(x, z, type="p", pch=15, col="black", cex=2.5)

     results <- flexisoreg(y, x, lambda=1, alpha.location=0.05, alpha.adjacency=1)
     plot(x,y, main="Location Restriction",cex.axis=1.5, cex.lab=1.5, cex.main=1.5, cex=1.5)
     lines(x, results$estimate, type="p", pch=15, col="black", cex=2.5)

     results <- flexisoreg(y, x, lambda=1, alpha.location=0.05, alpha.adjacency=0.05)
     plot(x,y, main="Location and Strong Order Restrictions", 
     cex.axis=1.5, cex.lab=1.5, cex.main=1.5, cex=1.5)
     lines(x, results$estimate, type="p", pch=15, col="black", cex=2.5)

     results <- flexisoreg(y, x, lambda=0, alpha.location=1, alpha.adjacency=0.95)
     plot(x,y, main="Weak Order Restriction",cex.axis=1.5, cex.lab=1.5, cex.main=1.5, cex=1.5)
     lines(x, results$estimate, type="p", pch=15, col="black", cex=2.5)

     results <- flexisoreg(y, x, lambda=0, alpha.location=1, alpha.adjacency=0.5)
     plot(x,y, main="General Order Restriction",cex.axis=1.5, cex.lab=1.5, cex.main=1.5, cex=1.5)
     lines(x, results$estimate, type="p", pch=15, col="black", cex=2.5)

     results <- flexisoreg(y, x, lambda=0, alpha.location=1, alpha.adjacency=0.05)
     plot(x,y, main="Strong Order Restriction",cex.axis=1.5, cex.lab=1.5, cex.main=1.5, cex=1.5)
     lines(x, results$estimate, type="p", pch=15, col="black", cex=2.5)


[Package GeneF version 1.0.1 Index]