ols: linear OLS-regression

Description Usage Arguments Details Value Author(s) Examples

View source: R/ols.R

Description

The function estimates a linear model by using Ordinary-Least-Squares regression. OLS-coefficients and common summary statistics of the estimation are provided.

Usage

1
  ols(X, Y, data)

Arguments

X

A data matrix with a column of 1 for each observation and one column for each independent variable must be specified.

Y

A data matrix with a column for the dependent variable must be specified.

data

The name of the used data-frame must be specified, so that the names of the variables can be extracted.

Details

Given the matrix of the dependent variabe Y and the matrix of the independent variables X, the function ols returns an estimate of the respective OLS-coefficients for each independent variable and the estimate of the intercept for the dependent variable. Additionally, ols also returns common summary statistics for the model.

Value

The output is a k+1x6 matrix with the name of the estimated coefficients, estimate, standard error, t-value and p-value; and a summary of the residuals, residual standard error, degrees of freedom, multiple-R-squared and F-statistics

Author(s)

Johannes Besch, [email protected], Marco Radojevic [email protected]

Examples

1
2
3
require(MASS)
model1 = glm(Sex ~ Height + Smoke + Pulse, data=MASS::survey, family=binomial(link=logit))
summary(model1)

RadojevicM/OLSLog2 documentation built on Nov. 18, 2017, 8:53 a.m.