lm.fun: ordinary least squares (OLS) regression

Description Usage Arguments Details Value Author(s) Examples

View source: R/lm.fun.R

Description

The function calculates an OLS regression and prints the results to the console.

Usage

1
lm.fun(y, x, varNames = c())

Arguments

y

dependent variable which must be of type numeric

x

list of independent variables which must be vectors and of type numeric or factor.

varNames

OPTIONAL a vector of all the variable names: the first variable name in the vector must be the one of the dependent variable, followed by the names of the independent variables. default: c()

Details

The function prints the OLS regression results to the console; including information about the coefficients, standard errors, t- and p-values, residuals, R squared and the F-Statistics. However, the function does not return. The printed output is similar to the one that is provided by summary() for lm() models.

Value

The function does not return a value, but prints the OLS regression results to the console.

Author(s)

Saro Gibilisco, [email protected] Rolf Badat, [email protected]

Examples

1
2
3
dat <- MASS::survey
dat <- na.omit(dat)
lm.fun(dat$Pulse, list(dat$Age, dat$Sex, dat$Smoke), c("Pulse", "Age", "Sex", "Smoke"))

rodat/hw2 documentation built on Nov. 18, 2017, 8:21 p.m.

Related to lm.fun in rodat/hw2...