R/coef.R

Defines functions coef.linreg

Documented in coef.linreg

coef.linreg <- function(formula, data) {

  #' Method coef.linreg
  #'
  #' @export coef.linreg
  #' @param l_full_linreg The full output of the linear regression model.
  #'
  #' @return The coefficients of the linear regression analysis of the input data
  #' @examples
  #' coef.linreg(Petal.Length~Species, data = iris)
  #' coef.linreg(Employed ~ ., longley)
  #' @source \url{http://web.nchu.edu.tw/~numerical/course1012/ra/Applied_Regression_Analysis_A_Research_Tool.pdf}

  l_full_linreg <- linreg(formula, data)


  #Coeff <- round(Coeff, digits=3)


  return(unlist(l_full_linreg$Coeff, use.names = TRUE))
}
#coef.linreg(Employed ~ ., longley)
AdelaidaK/Lab4AdvancedR documentation built on Dec. 17, 2021, 7:40 a.m.