R/ExactE2Val.R

`ExactE2Val` <-
function (x,y)
  {
  
val <- c(
0.33300, 0.25000, 0.20000, 0.16667, 0.14286, 0.12500, 0.11111, 0.10000, 0.09091, 0.08333, 0.07692, 0.07143, 0.06667, 0.06250, 0.05882, 0.05556, 0.05263, 0.05000,
0.50000, 0.45833, 0.41667, 0.38056, 0.35000, 0.32411, 0.30198, 0.28290, 0.26627, 0.25166, 0.23871, 0.22715, 0.21677, 0.20739, 0.19887, 0.19109, 0.18395, 0.17739,
0.16667 ,0.25000 ,0.29167 ,0.31250 ,0.32222, 0.32569, 0.32552, 0.32316, 0.31950, 0.31507, 0.31019, 0.30508, 0.29989, 0.29469, 0.28956, 0.28452, 0.27960, 0.27482,
0.00000, 0.04167, 0.08333, 0.11806, 0.14583, 0.16788, 0.18542, 0.19943, 0.21068, 0.21974, 0.22708, 0.23301, 0.23782, 0.24170, 0.24482, 0.24730, 0.24926, 0.25078,
0.00000, 0.00000, 0.00833 ,0.02083, 0.03472, 0.04861, 0.06166, 0.07422, 0.08560, 0.09602, 0.10554, 0.11422, 0.12214, 0.12937, 0.13598, 0.14203, 0.14757, 0.15265,
0.00000, 0.00000 ,0.00000, 0.00139, 0.00417, 0.00799, 0.01250, 0.01744, 0.02260, 0.02785, 0.03309, 0.03827, 0.04333, 0.04826, 0.05303, 0.05764, 0.06208, 0.06635,
0.00000, 0.00000 ,0.00000, 0.00000, 0.00020, 0.00069, 0.00150, 0.00260, 0.00395, 0.00551, 0.00723, 0.00907, 0.01102, 0.01304, 0.01511, 0.01722, 0.01934, 0.02148,
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00002, 0.00010, 0.00024, 0.00045, 0.00075, 0.00111, 0.00155, 0.00205, 0.00261, 0.00322, 0.00388, 0.00459, 0.00532,
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00001, 0.00003, 0.00007, 0.00012, 0.00019, 0.00028, 0.00039, 0.00052, 0.00067, 0.00084, 0.00103,
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00001, 0.00002, 0.00003, 0.00004, 0.00006, 0.00009, 0.00012, 0.00016, 
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00002, 0.00000, 0.00000, 0.00001, 0.00001, 0.00001, 0.00002, 
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00002, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000,
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00002, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000,
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00002, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00002, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00002, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00002, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00002, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00002, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 
0.00000, 0.00000 ,0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00002, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000 

)

plevel <- t(matrix(val,18,20)) ## ?? why fixed dimension ??? 
dose <- x
#if(is.matrix(y) == TRUE){
#	data <- y
#	stat <- IsoGenem(dose,data) 
#	} else if(is.matrix(y) == FALSE){
#	#ymat <- rbind(y,y)
#	#data <- ymat[1,,drop=FALSE]
#	data <- y
#	stat <- IsoGene1(dose,data) 
#	}

#ymat <- rbind(y,y)
#data <- ymat[1,,drop=FALSE]
data <- y
stat <- IsoGenem(dose,data)

E2 <- cbind(stat[[1]],stat[[6]]) ## TAKING THE E^2 VALUE ##
E2max  <- apply(E2,1,max)
Dir <-  stat [[11]]
NN <- ncol(data)
doselev <- length (unique(dose))
pval <- function (E,lev )
{
pv <- 0
    for (i in 2:lev )
{
pv <- pv + ((plevel[i,lev -2]*(1-pbeta(E,0.5*(i-1),0.5*(NN-i)))))
}
return(pv)
}

asympval <- data.frame(E2max ,pval (E2max,doselev ),Dir )
names (asympval) <- c("E2", "Asymp.pvalue","Direction")
return(asympval )
}

Try the IsoGeneGUI package in your browser

Any scripts or data that you put into this service are public.

IsoGeneGUI documentation built on May 2, 2019, 4:49 p.m.