Learn R Programming

Tmisc (version 1.0.1)

lmp: Linear model p-value

Description

Extract F-test p-value from a linear model object. Can also use broom::glance(fit).

Usage

lmp(modelobject)

Value

The p-value on the f-test of a linear model object testing the null hypothesis that R^2==0.

Arguments

modelobject

A model object of class lm.

Examples

Run this code
# simulate some (e.g. SNP genotype) data
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)
#shows that the F-test is 0.006641
summary(fit)
#can't access that p-value using this
names(summary(fit)) 
# this doesn't work either
names(fit)
lmp(fit)

Run the code above in your browser using DataLab