extractp: Easily access p-values from linear models

Description Usage Arguments Value Author(s) See Also Examples

Description

This function gives the user easy access to p-values for specific predictors from a linear model. It is mainly used to easily pass p-values to other functions.

Usage

1
extractp(pred, fit)

Arguments

pred

the predictor from the linear model whose p-value is desired

fit

a linear model of type "lm" containing the desired predictor

Value

the p-value for the desired predictor from the linear model

Author(s)

Cory Langille <lang1729@gmail.com>

See Also

lm, pStepwise

Examples

1
2
3
4
5
6
7
#Using the leafshape dataset from the DAAG package
data(leafshape)
attach(leafshape)
currentModel <- lm(bladelen~., data = leafshape)
extractp("bladewid", currentModel)
#    bladewid
#    2.579703e-43

c-langille/pStepwise documentation built on May 13, 2019, 9:55 a.m.