lm.pval: Function to calculate p-values for ordinary multiple linear...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/helpers.R

Description

Calculates (classical) p-values for an ordinary multiple linear regression in the n > p situation.

Usage

1
lm.pval(x, y, exact = TRUE, ...)

Arguments

x

Design matrix (without intercept).

y

Response vector.

exact

Logical. TRUE if p-values based on t-distribution should be calculated. FALSE if normal distribution should be used as approximation.

...

Additional arguments to be passed to lm.

Details

A model with intercept is fitted but the p-value of the intercept is not reported in the output.

Value

Vector of p-values (not including the intercept).

Author(s)

Lukas Meier

See Also

hdi

Examples

1
2
3
4
x <- matrix(rnorm(100 * 5), nrow = 100, ncol = 5)
y <- x[,1] * 2 + x[,2] * 2.5 + rnorm(100)
pval <- lm.pval(x, y)
pval

hdi documentation built on May 27, 2021, 3 p.m.