linear_regression: linear_regression

Description Usage Arguments Value Examples

View source: R/linear_regression.R

Description

linear_regression

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
linear_regression(
  y,
  x,
  intercept = T,
  y_bars = F,
  ss = F,
  variances = F,
  t_test = F,
  f_test = F,
  hat_matrix = F,
  residuals = F
)

Arguments

y

a vector, outcomes.

x

a numerical matrix, each row represents an observation and each column represents a covariate.

intercept

a logical value, TRUE by default, indicating should the function include a intercept for the user.

y_bars

a logical value, indicating should the function output the estimated y's. It is FALSE by default, but will be set TRUE if either ss, variances, t_test, f_test or residuals is set TRUE

ss

a logical value, indicating should the function output sum of squares. It is FALSE by default, but will be set TRUE if either variances, f_test or t_test is set TRUE

variances

a logical value, indicating should the function output variances. It is FALSE by default, but will be set TRUE if t_test is set TRUE

t_test

a logical value, indicating should the function output results of t test.

f_test

a logical value, indicating should the function output results of f test.

hat_matrix

a logical value, indicating should the function output the hat matrix.

residuals

a logical value, indicating should the function output residuals.

Value

the regression result, a list

Examples

1
linear_regression(c(3,5,6),c(1,2,3))

BangyaoZhao/package2 documentation built on Nov. 21, 2019, 3:55 a.m.