Title: | Package for Generalized F-Statistics |
---|---|
Description: | Implementation of several generalized F-statistics. The current version includes a generalized F-statistic based on the flexible isotonic/monotonic regression or order restricted hypothesis testing. Based on: Y. Lai (2011) <doi:10.1371/journal.pone.0019754>. |
Authors: | Yinglei Lai [aut, cre] |
Maintainer: | Yinglei Lai <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.1 |
Built: | 2024-12-06 06:34:18 UTC |
Source: | CRAN |
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.
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)
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)
y |
a vector of observed data |
x |
a vector of ordinal group labels correponding to |
lambda |
a lower location bound for partitioned groups other than the first one |
alpha.location |
|
alpha.adjacency |
|
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 -statistic, which is convenient for multiple comparison.
groups |
A partition of sample groups |
estimates |
estimated population means |
statistic |
an |
Since the -value of test has to be evaluated by permutation method, these functions will not return any
-value. For the permutation
-value of an individual test, see
flexisoreg.pvalue
and flexmonoreg.pvalue
. For the pooled permutation -values of multiple tests, see
flexisoreg.poolpvalues
and flexmonoreg.poolpvalues
.
Yinglei Lai [email protected]
Yinglei Lai (2007) A flexible order restricted hypothesis testing and its application to gene expression data. Technical Report
#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)
#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)
These functions evaluate the -values from an individual or multiple flexible order restricted hypothesis testing.
flexisoreg.pvalue(y, x, lambda=0, alpha.location=1, alpha.adjacency=0.5, B=100) flexisoreg.poolpvalues(m, x, lambda=0, alpha.location=1, alpha.adjacency=0.5, B=100) flexmonoreg.pvalue(y, x, lambda=0, alpha.location=1, alpha.adjacency=0.5, B=100) flexmonoreg.poolpvalues(m, x, lambda=0, alpha.location=1, alpha.adjacency=0.5, B=100)
flexisoreg.pvalue(y, x, lambda=0, alpha.location=1, alpha.adjacency=0.5, B=100) flexisoreg.poolpvalues(m, x, lambda=0, alpha.location=1, alpha.adjacency=0.5, B=100) flexmonoreg.pvalue(y, x, lambda=0, alpha.location=1, alpha.adjacency=0.5, B=100) flexmonoreg.poolpvalues(m, x, lambda=0, alpha.location=1, alpha.adjacency=0.5, B=100)
m |
a matrix of observed data, where samples are in columns and variables are in rows |
y |
a vector of observed data |
x |
a vector of ordinal group labels correponding to |
lambda |
a lower location bound for partitioned groups other than the first one |
alpha.location |
|
alpha.adjacency |
|
B |
the number of permutations for |
flexisoreg.pvalue
and flexmonoreg.pvalue
provide the permutation -value for an individual flexible order restricted hypothesis testing.
flexisoreg.poolpvalues
and flexmonoreg.poolpvalues
provide the pooled permutation -values for multiple flexible order restricted hypothesis testing.
flexisoreg.pvalue
and flexmonoreg.pvalue
return a permutation -value.
flexisoreg.poolpvalues
and flexmonoreg.poolpvalues
return a vector of pooled permutation -values.
These functions are used in conjunction with flexisoreg
, flexisoreg.stat
, flexmonoreg
and flexmonoreg.stat
.
Yinglei Lai [email protected]
Yinglei Lai (2007) A flexible order restricted hypothesis testing and its application to gene expression data. Technical Report
#generate ordinal group lables x x <- runif(100)*6 x <- round(x,0)/3 #generate true values z z <- round(x^2,0) #generate 6 vectors in a matrix for observed values, some noises and some not m <- array(double(6*100), dim=c(6,100)) for(k in 1:3) m[k,] <- rnorm(100) for(k in 4:6) m[k,] <- z + rnorm(100) #print default results par(mfrow=c(2,3)) for(k in 1:6){ print(paste("The ", k, "-th vector", sep="")) y <- m[k,] plot(x,y,main=k) print(flexisoreg.stat(y,x)) print(flexisoreg.pvalue(y,x,B=20)) print(flexisoreg.stat(y,0-x)) print(flexisoreg.pvalue(y,0-x,B=20)) print(flexmonoreg.stat(y,x)) print(flexmonoreg.pvalue(y,x,B=20)) } flexisoreg.poolpvalues(m, x, B=20) flexmonoreg.poolpvalues(m, x, B=20)
#generate ordinal group lables x x <- runif(100)*6 x <- round(x,0)/3 #generate true values z z <- round(x^2,0) #generate 6 vectors in a matrix for observed values, some noises and some not m <- array(double(6*100), dim=c(6,100)) for(k in 1:3) m[k,] <- rnorm(100) for(k in 4:6) m[k,] <- z + rnorm(100) #print default results par(mfrow=c(2,3)) for(k in 1:6){ print(paste("The ", k, "-th vector", sep="")) y <- m[k,] plot(x,y,main=k) print(flexisoreg.stat(y,x)) print(flexisoreg.pvalue(y,x,B=20)) print(flexisoreg.stat(y,0-x)) print(flexisoreg.pvalue(y,0-x,B=20)) print(flexmonoreg.stat(y,x)) print(flexmonoreg.pvalue(y,x,B=20)) } flexisoreg.poolpvalues(m, x, B=20) flexmonoreg.poolpvalues(m, x, B=20)
Implementation of several generalized -statistics. The current version includes a generalized
-statistic based on the flexible isotonic/monotonic regression or order restricted hypothesis testing. Based on: Y. Lai (2011) <doi:10.1371/journal.pone.0019754>.
Package: | GeneF |
Type: | Package |
Version: | 1.0.1 |
Date: | 2022-05-06 |
License: | GPL version 2 or newer |
Yinglei Lai
Maintainer: [email protected]
Internal functions to support generalized -statistics.
get.numbers(x) t1p1(v, n) t1p2(v, n1, n2)
get.numbers(x) t1p1(v, n) t1p2(v, n1, n2)
x |
a vector of ordered groups of numbers |
v |
a vector of real numbers |
n |
the sample size of one-sample data |
n1 |
the first sample size of two-sample data |
n2 |
the second sample size of two-sample data |
get.numbers |
a vector of culmulative sample sizes from ordered groups |
t1p1 |
a |
t1p2 |
a |
Yinglei Lai [email protected]