EnsureIntercept: Ensure constant term in matrix

View source: R/EnsureIntercept.R

EnsureInterceptR Documentation

Ensure constant term in matrix

Description

A column of ones may be added

Usage

EnsureIntercept(x)

Arguments

x

Input matrix

Value

The input matrix possibly with a column of ones added

Author(s)

Øyvind Langsrud

Examples

x <- matrix(c(5, 8, 4, 2, 7, 6), 3, 2)
EnsureIntercept(x)
EnsureIntercept(cbind(x, 2))
EnsureIntercept(cbind(x, 0))
EnsureIntercept(matrix(0, 4, 0))

RegSDC documentation built on Aug. 19, 2022, 9:08 a.m.