From ee851a9e0f1947a862cb94cb5a83321c392da767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Pelletier?= Date: Wed, 19 Feb 2014 20:55:47 -0500 Subject: [PATCH] Ajout de l'impression du test chisquare.test --- R/chisquare.test.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/chisquare.test.R b/R/chisquare.test.R index 7d2c0e6..84f9698 100644 --- a/R/chisquare.test.R +++ b/R/chisquare.test.R @@ -20,6 +20,11 @@ chisquare.test <- function(DATA.hist,char.fun,...,alpha=0.05) # Compute the test statistic using chi-square distribution p.value <- pchisq(chisquare.stat<-sum((observed-expected)^2/expected), df<-length(classes)-2,lower.tail=FALSE) + # Print output + cat("Chi-Square Test based on CF\n\nTest statistic: ",chisquare.stat, + "\nDegree of freedom: ",df, + "\nP-value: ",p.value, + "\nReject H0 with confidence level ",1-alpha,"?: ",p.value