R/Hangartner.Diagnostic.R

Defines functions Hangartner.Diagnostic

Documented in Hangartner.Diagnostic

###########################################################################
# Hangartner.Diagnostic                                                   #
###########################################################################

Hangartner.Diagnostic <- function(x, J=2) {
     x <- as.vector(x)
     if(!all(x == round(x))) stop("x is not discrete.")
     N <- length(x)
     j <- rep(1:J, each=N/J)
     if(N %% J != 0) stop("N must be divisible by J.")
     tab <- table(x, j)
     out <- chisq.test(x, j)
     class(out) <- "hangartner"
     return(out)
     }

#End
LaplacesDemonR/LaplacesDemon documentation built on April 1, 2024, 7:22 a.m.