diff --git a/R/oneSample.R b/R/oneSample.R index ed29883..1f8e46e 100644 --- a/R/oneSample.R +++ b/R/oneSample.R @@ -20,9 +20,9 @@ oneSample<- function(X,alternative = "two.sided"){ #Test = rowMeans(X)/(sqrt((rowV)/n)) Test <- ifelse(rowV==0,0, rowMeans(X)/(sqrt((rowV)/n))) pv <- switch(alternative, - "two.sided" = 2*(pt(abs(Test), df = n-1, lower.tail=FALSE)), - "greater" = pt(Test, df = n-1, lower.tail=FALSE), - "lower" = 1-pt(Test, df = n-1, lower.tail=FALSE)) + "two.sided" = 2*(pnorm(abs(Test), lower.tail=FALSE)), + "greater" = pnorm(Test, lower.tail=FALSE), + "lower" = 1-pnorm(Test, lower.tail=FALSE)) res <- list(Test = Test, pv = pv) diff --git a/R/signTest.R b/R/signTest.R index fa5d410..10a818f 100644 --- a/R/signTest.R +++ b/R/signTest.R @@ -50,14 +50,14 @@ signTest <- function(X, B = 999, alternative = "two.sided", seed = NULL, mask = if(!rand){ pv <- switch(alternative, - "two.sided" = 2*(pt(abs(Test), df = n-1, lower.tail=FALSE)), - "greater" = pt(Test, df = n-1, lower.tail=FALSE), - "lower" = 1-pt(Test, df = n-1, lower.tail=FALSE)) + "two.sided" = 2*(pnorm(abs(Test), lower.tail=FALSE)), + "greater" = pnorm(Test, lower.tail=FALSE), + "lower" = 1-pnorm(Test, lower.tail=FALSE)) pv_H0 <- switch(alternative, - "two.sided" = 2*(pt(abs(Test_H0), df = n-1, lower.tail=FALSE)), - "greater" = pt(Test_H0, df = n-1, lower.tail=FALSE), - "lower" = 1-pt(Test_H0, df = n-1, lower.tail=FALSE)) + "two.sided" = 2*(pnorm(abs(Test_H0), lower.tail=FALSE)), + "greater" = pnorm(Test_H0, lower.tail=FALSE), + "lower" = 1-pnorm(Test_H0, lower.tail=FALSE)) }else{ Test_matrix <- cbind(Test, Test_H0)