modelP | R Documentation |
Extract the p-value estimate from either a linear model (lm) or ANOVA (aov) object.
modelP(model, var_v = NULL, round_v = NULL, verbose_v = F)
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 |
numeric vector of p-value
set.seed(1)
x <- sample(1:100, size = 10)
y <- sample(1:100, size = 10)
my_lm <- lm(y ~ x)
modelP(my_lm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.