Ajout de l'impression du test chisquare.test
This commit is contained in:
parent
9f17d7a2f7
commit
ee851a9e0f
1 changed files with 5 additions and 0 deletions
|
@ -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<alpha)
|
||||
# Create the return list
|
||||
list(chisquare.stat=chisquare.stat,df=df,reject=p.value<alpha,p.value=p.value)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue