X-Git-Url: http://iramuteq.org/git?a=blobdiff_plain;f=Rscripts%2Fchdquest.R;h=f40a368a1c3894f152b9094c085301194fa306d7;hb=refs%2Fheads%2F3.0;hp=6a271aa6f0743d3c9b84d91b9caf2b9fa5c3f43e;hpb=54fef96ad151ba25920f3e589b39a83c3f62ae2c;p=iramuteq diff --git a/Rscripts/chdquest.R b/Rscripts/chdquest.R index 6a271aa..f40a368 100644 --- a/Rscripts/chdquest.R +++ b/Rscripts/chdquest.R @@ -1,5 +1,5 @@ #Author: Pierre Ratinaud -#Copyright (c) 2008-2009 Pierre Ratinaud +#Copyright (c) 2008-2020 Pierre Ratinaud #License: GNU/GPL fille<-function(classe,classeuce) { @@ -157,7 +157,7 @@ Rchdquest<-function(tableuc1,listeuce1,uceout ,nbt = 9, mincl = 2, mode.patate = chitable[2,1]<-poids2[j]-chitable[1,1] chitable[2,2]<-nrow(classeuce1)-poids2[j]-chitable[1,2] chitest<-chisq.test(chitable,correct=FALSE) - if ((chitable[1,1]-chitest$expected)<0) { + if ((chitable[1,1]-chitest$expected[1,1])<0) { chicroise[i,j]<--round(chitest$statistic,digits=7) } else { chicroise[i,j]<-round(chitest$statistic,digits=7)