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, sarogiba@bluewin.ch Rolf Badat, rolf.badat@uzh.ch

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/hw2package666 documentation built on May 29, 2019, 8:38 a.m.