Learn R Programming

RegSDC (version 0.4.0)

EnsureIntercept: 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

Examples

Run this code
# NOT RUN {
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))
# }

Run the code above in your browser using DataLab