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