###################<-60 Characters Wide->###################
# null.check()
# W. A. Green
# Department of Geology, Yale University
# walton.green@yale.edu
#
# Last Modified: May 6, 2005
# Checks for a null of no significant difference among the rows
# of a matrix
# Returns 1 iff the matrix was unlikely to have occurred by chance at the given
# significance level. The lower the significance level, the more likely
# the check is to allow a
# for sig = 1, everything is broken down
null.check <- function(x, pll, sig = 0.05){
if(is.null(dim(x))){
return(0)
}else if(any(dim(x) == 1)){
return(0)
}
dfs <- (nrow(x) - 1) * (ncol(x) - 1)
if(pchisq(pll, df = dfs) < sig){
return(0)
}else{
return(1)
}
} # End of function