R/summary.supresid.R

Defines functions summary.supresid

Documented in summary.supresid

summary.supresid <- function(object, ...)
{
  x <- object
	k <- x$k
	n <- nrow(x$residuals)
	vol <- diff(x[[1]]$xcoord) * diff(x[[1]]$ycoord) * diff(x[[1]]$tcoord)
	n.exp <- k * vol
	if(n < n.exp)
		p.val <- ppois(n, n.exp) 
	if(n > n.exp)
		p.val <- ppois(n, n.exp, lower.tail = FALSE) 
	if(n == n.exp)
		p.val <- 1
	Y <- list(k = k, n = n, n.exp = n.exp, p.val = p.val)
	class(Y) <- "summary.supresid"
	return(Y)
}

Try the stppResid package in your browser

Any scripts or data that you put into this service are public.

stppResid documentation built on May 29, 2017, 3:48 p.m.