StatsModels not adapted yet?

So far I have estimated data (Rotwein / red wine) in the form of a DataFrame in this form a linear model (using GLM):

LinReg = lm(@formula(quality ~ alcohol), Rotwein)

quality and alcohol are values within the DataFrame. But now I get warning messages due to modifications of the DataFrame package, which the StatsModels package probably can’t handle.

Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.
│   caller = (::getfield(StatsModels, Symbol("##18#19")){DataFrame})(::Symbol) at modelframe.jl:145
└ @ StatsModels C:\Users\guent\.juliapro\JuliaPro_v1.2.0-1\packages\StatsModels\pBxdt\src\modelframe.jl:145

Does anyone have a clue for me on how to avoid these alerts?

I know the new “column call” of DataFrame (e.g. Rotwein[!,:quality]), but have no idea how to use it in the lm example.:thinking:

I’m thankful for every clue!

What’s your StatsModels version? This is probably a JuliaPro issue, I’m not getting these issues in the latest release.

1 Like

That may be the solution. I am using JuliaPro 1.2.0-1 and StatsModels v0.5.0 is included. But the current version is 0.6.6. I will try to include it in JuliaPro. I’ll get back to you…!

I have watched the documentary about StatsModels and also think that the “old” version is the problem, which is included in JuliaPro. The integration of the newest StasModels version is (for me) difficult. I wrote a mail to JuliaPro and see what happens. @nilshg, thank you for your hint!

2 Likes

I’m very curious to hear about this documentary :slight_smile:

This is definitely an issue with using an outdated version of statsmodels and a relatively recent version of dataframes. I think the compatibility for changes in the dataframes API didn’t land until after the 0.6 series was released, which is quite different internally but should still be compatible with GLM etc. (and appropriate version bounds should be in place in the General registry, but I’m not sure what juliapro uses). If you’re having trouble with StatsModels.jl please let us know (and feel free to tag me and I’ll help if I can)! We’re happy to help.

1 Like

JuliaPro uses a private curated registry, the latest version of StatsModels in the JuliaProRegistry as of now is 0.6.6 (It was updated recently), please try running a Pkg.update() to upgrade the version of StatsModels in your environment and see if the upgraded version solves your issue. You can also install General registry in your JuliaPro installation by executing following command

Pkg.Registry.add("General")

@ dave.f.kleinschmidt I see it the same way! I continue to receive the above warning message when I want to estimate models. When I access individual data via DataFrames, it works (because I made the adjustments)! Currently, I’m ignoring the warnings, as I assume they will have disappeared in a future release of JuliaPro.

Harsha I used both update methods (again for security) and when I check the package status I still see that:

(v1.2) pkg> status --manifest
    Status `C:\Users\guent\.juliapro\JuliaPro_v1.2.0-1\environments\v1.2\Manifest.toml`
...
[3eaba693] StatsModels v0.5.0
...

Do you see another option?

Thank you for your support! :grinning:

What happens if you try add StatsModels@0.6?

Hi andreasnoack, thanks for the tip, but nothing good is happening! If I interpret it correctly, compatibility problems are shown:

(v1.2) pkg> add StatsModels@0.6
  Updating registry at `C:\Users\guent\.juliapro\JuliaPro_v1.2.0-1\registries\General`
  Updating git-repo `https://pkg.juliacomputing.com/registry/General`
  Updating registry at `C:\Users\guent\.juliapro\JuliaPro_v1.2.0-1\registries\JuliaPro`
  Updating git-repo `https://pkg.juliacomputing.com//registry/JuliaPro`
 Resolving package versions...
ERROR: Unknown package Compat found in the compatibility requirements of WebIO [0f1e0344]
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] Pkg.GraphType.Graph(::Dict{Base.UUID,Set{VersionNumber}}, ::Dict{Base.UUID,Dict{Pkg.Types.VersionRange,Dict{String,Base.UUID}}}, ::Dict{Base.UUID,Dict{Pkg.Types.VersionRange,Dict{String,Pkg.Types.VersionSpec}}}, ::Dict{Base.UUID,String}, ::Dict{Base.UUID,Pkg.Types.VersionSpec}, ::Dict{Base.UUID,Pkg.Types.Fixed}, ::Bool) at C:\Users\julia\AppData\Local\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\GraphType.jl:278
 [3] deps_graph(::Pkg.Types.Context, ::Dict{Base.UUID,String}, ::Dict{Base.UUID,Pkg.Types.VersionSpec}, ::Dict{Base.UUID,Pkg.Types.Fixed}) at C:\Users\julia\AppData\Local\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\Operations.jl:319
 [4] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Nothing) at C:\Users\julia\AppData\Local\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\Operations.jl:386
 [5] resolve_versions! at C:\Users\julia\AppData\Local\Julia-1.2.0\share\julia\stdlib\v1.2\Pkg\src\Operations.jl:328 [inlined]
 [6] #add_or_develop#63(:

Just for completeness: StatsModels is still available in version v0.5.0. I think it’s a JuliaPro problem (registration and dependencies), but I can’t imagine that I’m the “only” user who has such a problem…

I assume Harsha may be able to help?

I happened to hit the same issue today. Could you try removing the General registry with Pkg.Registry.rm("General") and then try to add StatsModels@0.6 again?

I have removed General and executed StatsModels@0.6 again. Works better, but unfortunately there are now concrete complaints about GLM:

(v1.2) pkg> add StatsModels@0.6
  Updating registry at `C:\Users\guent\.juliapro\JuliaPro_v1.2.0-1\registries\JuliaPro`
  Updating git-repo `https://pkg.juliacomputing.com//registry/JuliaPro`
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package StatsModels [3eaba693]:
 StatsModels [3eaba693] log:
 ├─possible versions are: [0.3.0-0.3.1, 0.4.0, 0.5.0, 0.6.0-0.6.6] or uninstalled
 ├─restricted to versions 0.6 by an explicit requirement, leaving only versions 0.6.0-0.6.6
 └─restricted by compatibility requirements with GLM [38e38edf] to versions: 0.5.0 — no versions left
   └─GLM [38e38edf] log:
     ├─possible versions are: [1.0.0-1.0.2, 1.1.0-1.1.1, 1.2.0, 1.3.0-1.3.3] or uninstalled
     └─restricted to versions 1.1.1 by an explicit requirement, leaving only versions 1.1.1

If I interpret this correctly, StatsModels and GLM do not understand each other in this version combination. JuliaPro says that the packages bound together by registration work together. And that will be tested according to JuliaPro’s description. The warnings are not nice, but I hope that with the next JuliaPro version the problem will disappear… :thinking:

[a93c6f00] DataFrames v0.19.4
...
[38e38edf] GLM v1.1.1
...
[3eaba693] StatsModels v0.5.0

But maybe Harsha has an idea?

It was the kind of output I was looking for. I’m wondering why GLM is not getting updated. Could you try up GLM and if that doesn’t change anything then add GLM@1.3?

One of the preinstalled package in your environment has set a compatibility bound which is blocking StatsModels from getting upgraded, here are a few options to fix this issue

  1. Create a new environment and add StatsModels as the first package in that environment, once the latest version of StatsModels is installed, continue with the installation of other packages that you require for your development.
  2. Find the root cause for this issue i.e find which package is stopping StatsModels from getting upgraded, inorder to find this, we have to recursively add the latest version of package listed in the error.
    Example:- We now know GLM is stopping StatsModels@0.6 installation. As Andreas suggested, you now try adding GLM@1.3 , this would result in an error pointing to another package, try adding the latest version of that package and so on. Once you find the package responsible, share the entire trace with us, we will suggest what can be done based on your trace.

andreasnoack, Harsha, thank you for your feedback! Even if I try to install GLM@1.3, I get several error messages. They are all about dependencies…! These seem to exist not only for JuliaPro, but also for Julia1.2.0. If I look at the file GLM-Compat.toml (but I have to admit, I have too little knowledge), then I see hints for different StatsModels versions:

["1-1.1"]
Distributions = "0.16-0"
Reexport = "0.1-0"
SpecialFunctions = "0.6-0"
StatsBase = "0.22-0"
StatsFuns = "0.6-0"
julia = "0.7-1"

["1.0"]
StatsModels = "0.2-0.5"

["1.1-1.2"]
StatsModels = "0.5"

["1.2-1"]
Reexport = "0.1-0.2"
julia = "1"

["1.2-1.3.0"]
Distributions = "0.16-0.19"
StatsBase = "0.30"

["1.2-1.3.1"]
SpecialFunctions = "0.6-0.7"

["1.2-1.3.3"]
StatsFuns = "0.6-0.8"

["1.3-1"]
StatsModels = "0.6"

["1.3.1-1"]
Distributions = "0.16-0.21"
StatsBase = "0.30-0.32"

["1.3.2-1"]
SpecialFunctions = "0.6-0.8"

["1.3.4-1"]
StatsFuns = "0.6-0.9"

StatsModels expects a DataFrames version that is quite different from the installed DataFrames v0.19.4 version:

["0-0.3"]
DataFrames = "0.11.5-0"

["0-0.5"]
Compat = "0.63-2"
StatsBase = "0.22-0"
julia = "0.7-1"

["0.4-0.5"]
DataFrames = "0.15-0"

["0.6-0"]
julia = "1"

["0.6-0.6.6"]
StatsBase = "0.22.0-*"

["0.6.7-0"]
DataAPI = "1.1.0-1"
DataStructures = "0.17"
ShiftedArrays = "1"
StatsBase = "0.22-0.32"
Tables = "0.2.11-0.2"

And here I think only the package maintainers can help. Also, I don’t think it makes sense to replace one package version with another until it fits. At the moment it’s just a friendly warning that the way it is called is out of date. It’s not nice, but it doesn’t seem to interfere with the calculations. Thus I hope for a solution by package adjustment by the caretakers. It’s certainly not an easy job and that’s why I find it impressive what the package creators do! :clap:

Finally: I am currently trying to reinstall JuliaPro, but currently have GITHUB access problems.

Again, thank you!