# StatsModels not adapted yet?

**URL:** <https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342>\
**Category:** Statistics\
**Tags:** question, package\
**Created:** [October 26, 2019, 6:48pm UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342 "2019-10-26T18:48:19Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [October 26, 2019, 6:48pm UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/1 "2019-10-26T18:48:19Z")

</div>

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

```julia
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.

```julia
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.🤔

I’m thankful for every clue!

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [October 26, 2019, 9:26pm UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/2 "2019-10-26T21:26:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [October 27, 2019, 8:07am UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/3 "2019-10-27T08:07:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [October 27, 2019, 10:14am UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/4 "2019-10-27T10:14:54Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![dave.f.kleinschmidt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dave.f.kleinschmidt/32/55_2.png) [@dave.f.kleinschmidt](https://discourse.julialang.org/u/dave.f.kleinschmidt)\
**Post date:** [November 11, 2019, 10:56pm UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/5 "2019-11-11T22:56:52Z")

</div>

I’m very curious to hear about this documentary 🙂

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.](https://discourse.julialang.org/t/psa-breaking-changes-in-statsmodels-v0-6-0-terms-2-0-son-of-terms/25626/7) (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.

---

<div class="post-metadata">

**Author:** ![Harsha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/harsha/32/1985_2.png) [@Harsha](https://discourse.julialang.org/u/Harsha)\
**Post date:** [November 12, 2019, 5:19am UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/6 "2019-11-12T05:19:27Z")

</div>

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

```julia
Pkg.Registry.add("General")

```

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [November 12, 2019, 10:36am UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/7 "2019-11-12T10:36:43Z")

</div>

@ [dave.f.kleinschmidt](https://discourse.julialang.org/u/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](https://discourse.julialang.org/u/Harsha) I used both update methods (again for security) and when I check the package status I still see that:

```julia
(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! 😀

---

<div class="post-metadata">

**Author:** ![andreasnoack](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andreasnoack/32/27_2.png) [@andreasnoack](https://discourse.julialang.org/u/andreasnoack)\
**Post date:** [November 12, 2019, 10:55am UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/8 "2019-11-12T10:55:18Z")

</div>

What happens if you try `add StatsModels@0.6`?

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [November 12, 2019, 3:58pm UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/9 "2019-11-12T15:58:41Z")

</div>

Hi [andreasnoack](https://discourse.julialang.org/u/andreasnoack), thanks for the tip, but nothing good is happening! If I interpret it correctly, compatibility problems are shown:

```julia
(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](https://discourse.julialang.org/u/Harsha) may be able to help?

---

<div class="post-metadata">

**Author:** ![andreasnoack](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andreasnoack/32/27_2.png) [@andreasnoack](https://discourse.julialang.org/u/andreasnoack)\
**Post date:** [November 12, 2019, 4:12pm UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/10 "2019-11-12T16:12:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [November 12, 2019, 4:31pm UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/11 "2019-11-12T16:31:37Z")

</div>

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

```julia
(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… 🤔

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

```

But maybe [Harsha](https://discourse.julialang.org/u/Harsha) has an idea?

---

<div class="post-metadata">

**Author:** ![andreasnoack](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andreasnoack/32/27_2.png) [@andreasnoack](https://discourse.julialang.org/u/andreasnoack)\
**Post date:** [November 12, 2019, 7:37pm UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/12 "2019-11-12T19:37:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Harsha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/harsha/32/1985_2.png) [@Harsha](https://discourse.julialang.org/u/Harsha)\
**Post date:** [November 13, 2019, 11:02am UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/13 "2019-11-13T11:02:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [November 13, 2019, 5:36pm UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342/14 "2019-11-13T17:36:17Z")

</div>

[andreasnoack](https://discourse.julialang.org/u/andreasnoack), [Harsha](https://discourse.julialang.org/u/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:

```julia
["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:

```julia
["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!_ 👏

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

Again, thank you!
