R/getP.R

#' @title getP
#' @description Internal function that retreived p value from a linear
#' regression model.
#' @param modelobject linear regression model that has been generated by the
#' linearRegr function.
#' @return
#' @noRd
#' @importFrom stats pf
getP <- function (modelobject) {

  if (class(modelobject) != "lm") stop("Not an object of class 'lm' ")

  f <- summary(modelobject)$fstatistic

  p <- pf(f[1],f[2],f[3],lower.tail=FALSE)

  attributes(p) <- NULL

  return(p)

}

Try the TimiRGeN package in your browser

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

TimiRGeN documentation built on April 17, 2021, 6:03 p.m.