# 0.7: how to call linreg?

**URL:** https://discourse.julialang.org/t/0-7-how-to-call-linreg/13105
**Category:** General Usage
**Created:** [August 9, 2018, 3:33pm UTC](https://discourse.julialang.org/t/0-7-how-to-call-linreg/13105 "2018-08-09T15:33:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![LeoK987](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leok987/32/4880_2.png) [@LeoK987](https://discourse.julialang.org/u/LeoK987)
#### Post date: [August 9, 2018, 3:33pm UTC](https://discourse.julialang.org/t/0-7-how-to-call-linreg/13105/1 "2018-08-09T15:33:54Z")

</div>

I did add StatsBase as instructed, but still fail:

```julia
$ 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-element Array{Int64,1}:
  1
  2
  3
  4
  5
  6
  7
  8
  9
  ⋮
 42
 43
 44
 45
 46
 47
 48
 49
 50

julia> y=rand(50)
50-element Array{Float64,1}:
 0.7617834396266145 
 0.6379048953534547 
 0.40021790841211335
 0.9545693579078784 
 0.2513947682411304 
 0.25536026947148516
 0.4629605227317848 
 0.3377036794505843 
 0.46101256333717755
 ⋮                  
 0.15851794551099307
 0.3534059797211213 
 0.9757071421312202 
 0.07445292153533645
 0.5241411433580192 
 0.41539986402813156
 0.04729731573022877
 0.7069441222457196 
 0.24777203771345424

julia> using StatsBase

julia> linreg(x, y)
ERROR: linreg has been moved to the package StatsBase.jl.
Run `Pkg.add("StatsBase")` to install it, restart Julia,
and then run `using StatsBase` to load it.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] #linreg#810(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Array{Int64,1}, ::Vararg{Any,N} where N) at ./deprecated.jl:150
 [3] linreg(::Array{Int64,1}, ::Vararg{Any,N} where N) at ./deprecated.jl:150
 [4] top-level scope at none:0

```

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [August 9, 2018, 6:38pm UTC](https://discourse.julialang.org/t/0-7-how-to-call-linreg/13105/2 "2018-08-09T18:38:02Z")

</div>

See [Has `linreg` moved here? · Issue #398 · JuliaStats/StatsBase.jl · GitHub](https://github.com/JuliaStats/StatsBase.jl/issues/398)

---

<div class="post-metadata">

### Author: ![LeoK987](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leok987/32/4880_2.png) [@LeoK987](https://discourse.julialang.org/u/LeoK987)
#### Post date: [August 10, 2018, 3:33am UTC](https://discourse.julialang.org/t/0-7-how-to-call-linreg/13105/3 "2018-08-10T03:33:49Z")

</div>

Thanks for the link. Guess I have to embed linear\_regression in my own code for now.
