lmp: Linear model p-value

lmpR Documentation

Linear model p-value

Description

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

Usage

lmp(modelobject)

Arguments

modelobject

A model object of class lm.

Value

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

Examples

# 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)


Tmisc documentation built on Aug. 23, 2023, 1:07 a.m.