Answers for "how to extract p value from lm in r"

0

how to extract p value from lm in r

lmp <- 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=F)
    attributes(p) <- NULL
    return(p)
}

> lmp(modelobject)
[1] 1.622665e-05
Posted by: Guest on April-15-2021

Code answers related to "how to extract p value from lm in r"

Browse Popular Code Answers by Language