modelP: Extract p-value from model

View source: R/modelP.R

modelPR Documentation

Extract p-value from model

Description

Extract the p-value estimate from either a linear model (lm) or ANOVA (aov) object.

Usage

modelP(model, var_v = NULL, round_v = NULL, verbose_v = F)

Arguments

model

model object of class 'lm' for linear model, classes 'lm' and 'aov' for ANOVA.

var_v

character string of variable to get p-value from. If NULL (default) will take 1st.

round_v

logical. TRUE - round p-value to 3 decimals; FALSE - do not round.

verbose_v

logical. TRUE - print model type; FALSE - don't print

Value

numeric vector of p-value

Examples

set.seed(1)
x <- sample(1:100, size = 10)
y <- sample(1:100, size = 10)
my_lm <- lm(y ~ x)
modelP(my_lm)

weshorton/wrh.rUtils documentation built on Oct. 28, 2024, 7:24 a.m.