R/lcreg.aov.R

Defines functions lcreg.aov

Documented in lcreg.aov

lcreg.aov <- function(mod0, mod1) {
  sse0 <- sum( mod0$residuals^2 )
  sse1 <- sum( mod1$residuals^2 )
  p <- length(mod1$be)
  n <- length(mod1$residuals)
  stat <- (sse0 - sse1) / ( sse1 / (n - p) )
  pvalue <- pf(stat, 1, n - p, lower.tail = FALSE)
  res <- c(stat, pvalue)
  names(res) <- c( "F statistic", "p-value" )
  res
}

Try the Compositional package in your browser

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

Compositional documentation built on Oct. 9, 2024, 5:10 p.m.