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. 23, 2023, 5:09 p.m.