lmp: lmp

Description Usage Arguments Value Author(s) Examples

Description

Extracts the p-value from lm(). Source: Stephen Turner (http://www.gettinggeneticsdone.com/2011/01/rstats-function-for-extracting-f-test-p.html) In short, lmp extracts the F-statistic from the lm output and calculates the p-value based on the F-distribution.

Usage

1
lmp(modelobject)

Arguments

modelobject

lm output

Value

A p-value for a linear regression as obtained through lm()

Author(s)

Stephen Turner

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(42)
n=20
d=data.frame(x1=rbinom(n,2,.5), x2=rbinom(n,2,.5))
d=transform(d, y=x1+x2+rnorm(n))

#fit the linear model
fit=lm(y ~ x1 + x2, data=d)

summary(fit) #shows that the F-test is 0.006641
names(summary(fit)) #can't access that p-value using this!
names(fit) # this doesn't work either
lmp(fit) # uses the above function to capture the F-test p-value.
#Source: http://www.gettinggeneticsdone.com/2011/01/rstats-function-for-extracting-f-test-p.html

ND91/ndlib documentation built on Aug. 10, 2020, 11:59 a.m.

Related to lmp in ND91/ndlib...