Learn R Programming

RegKink (version 0.1.0)

reg: linear regression

Description

This is a function computing OLS estimates of linear model.

Usage

reg(X,y)

Arguments

y

A vector of response.

X

data matrix

Value

bols

The ols estimates of a linear regression model.

Examples

Run this code
# NOT RUN {
pt1 <- proc.time()
##Simulated data
set.seed(12345)
n=200
e = rnorm(n)
X = cbind(1,rnorm(n))
b0 =c(1,2)
y = X
# }
# NOT RUN {
<!-- %*%b0 + e -->
# }
# NOT RUN {
obj <- reg(X,y)

proc.time() - pt1
# }

Run the code above in your browser using DataLab