# Efficient way of doing linear regression

**URL:** https://discourse.julialang.org/t/efficient-way-of-doing-linear-regression/31232
**Category:** Performance
**Tags:** regression
**Created:** [November 18, 2019, 5:21pm UTC](https://discourse.julialang.org/t/efficient-way-of-doing-linear-regression/31232 "2019-11-18T17:21:15Z")
**Posts on this page:** 1
**Showing post:** 21

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [November 20, 2019, 9:58am UTC](https://discourse.julialang.org/t/efficient-way-of-doing-linear-regression/31232/21 "2019-11-20T09:58:09Z")

</div>

I don’t think I have seen people asking for `linreg` for more than a year now, but I have a very different impression: when someone asks about linreg or linear regression in general, generally they are just directed to the appropriate package, eg:

> [@0.7: how to call linreg?](https://discourse.julialang.org/t/0-7-how-to-call-linreg/13105):
>
> I did add StatsBase as instructed, but still fail: $ julia \_ \_ \_ \_(\_)\_ | A fresh approach to technical computing (\_) | (\_) (\_) | Documentation: https://docs.julialang.org \_ \_ \_| |\_ \_\_ \_ | Type "?" for help, "]?" for Pkg help. | | | | | | |/ \_` | | | | |\_| | | | (\_| | | Version 0.7.0 (2018-08-08 06:46 UTC) \_/ |\_\_'\_|\_|\_|\_\_'\_| | Official http://julialang.org/ release |\_\_/ | x86\_64-pc-linux-gnu julia\> x=[1:50;] 50-eleme…

> [@Simple linear regresion in Julia? (and a comment on the stability of user interfaces)](https://discourse.julialang.org/t/simple-linear-regresion-in-julia-and-a-comment-on-the-stability-of-user-interfaces/20867):
>
> I have two arrays of the same dimension, and I want to do linear regression (least squares) between them. After searching in google, It seems that Julia used to have a very useful simple function linreg, for doing that But it seems that it has been removed in 1.1 (or moved to some package?) How can I replace it? Please help me! Just one comment: a thing that I really don’t like about Julia is that everything got deprecated every time. This makes impossible for new newcomers to pick a exa…

There are now excellent packages for various implementations of linear regression and more general models. They should be the first choice, there is little need to implement OLS in Julia for most users now.

---

_[View the full topic](https://discourse.julialang.org/t/efficient-way-of-doing-linear-regression/31232)._
