0.7: how to call linreg?

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-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

See Has `linreg` moved here? · Issue #398 · JuliaStats/StatsBase.jl · GitHub

1 Like

Thanks for the link. Guess I have to embed linear_regression in my own code for now.