FixedEffectjlr
FixedEffectjlr copied to clipboard
Undefined variable error: categorical not defined
Possibly an upstream error, but I'm unable to run the example from the README because of an undefined (categorical) variable problem. Reprex below. Any ideas?
FWIW I'm running the latest version of FixedEffectModels.jl (v0.9.0) in Julia itself.
library(FixedEffectjlr)
#> Loading required package: JuliaCall
julia <- JuliaCall::julia_setup()
#> Julia version 1.2.0 at location /opt/julias/julia-1.2.0/bin will be used.
#> Loading setup script for JuliaCall...
#> Finish loading setup script for JuliaCall.
df <- Ecdat::Cigar
reg_res <- FixedEffect(df,
lhs = "sales", rhs = "ndi",
fe = "state + year",
weights = "pop",
vcov = "cluster(state)")
#> Error: Error happens in Julia.
#> UndefVarError: categorical not defined
#> Stacktrace:
#> [1] top-level scope at none:0
#> [2] eval(::Module, ::Any) at ./boot.jl:330
#> [3] eval_string(::String) at /usr/lib/R/library/JuliaCall/julia/setup.jl:195
#> [4] docall(::Ptr{Nothing}) at /usr/lib/R/library/JuliaCall/julia/setup.jl:168
Created on 2019-10-03 by the reprex package (v0.3.0)
Thanks! There was a substantial update to FixedEffectModels.jl. I am waiting for @matthieugomez too stabilize before I implement the update.
You can always downgrade the julia version for now...
I believe b1dbb071b2490616049f1a292486ad65a942de82 closes it. It had to do with the change in FE.
Hi @eloualiche,
Still not working for me, unfortunately. Here's another reprex with a devtools install call at the top, if only to show that I'm up to date with the b1dbb071 commit.
devtools::install_github("eloualiche/FixedEffectjlr")
#> Skipping install of 'FixedEffectjlr' from a github remote, the SHA1 (b1dbb071) has not changed since last install.
#> Use `force = TRUE` to force installation
library(FixedEffectjlr)
#> Loading required package: JuliaCall
JuliaCall::julia_setup()
#> Julia version 1.2.0 at location /opt/julias/julia-1.2.0/bin will be used.
#> Loading setup script for JuliaCall...
#> Finish loading setup script for JuliaCall.
df <- Ecdat::Cigar
reg_res <- FixedEffect(df,
lhs = "sales", rhs = "ndi",
fe = "state + year",
weights = "pop",
vcov = "cluster(state)")
#> Error: Error happens in Julia.
#> UndefVarError: categorical not defined
#> Stacktrace:
#> [1] top-level scope at none:0
#> [2] eval(::Module, ::Any) at ./boot.jl:330
#> [3] eval_string(::String) at /usr/lib/R/library/JuliaCall/julia/setup.jl:195
#> [4] docall(::Ptr{Nothing}) at /usr/lib/R/library/JuliaCall/julia/setup.jl:168
Created on 2019-10-07 by the reprex package (v0.3.0)
I can confirm that the equivalent model works for me in Julia. However, I see that Matthieu is making another round of changes, so perhaps I'll try again in a week or three once things have stabilized.
PS -- Really like the idea of this package. Thanks for putting it together.
I hope ca07e4b0c0de5f8f0d51ceaf6957b87d3018e281 closes this.
Thanks for trying again. This was a mistake, I think I forgot to clean up some categorical call in julia.
Keep the issues / errors coming. I have myself ran into a number of crashes using it which might have to do with JuliaCall and memory mapping. It would be nice to know more about the issues others are facing.
All credits goes to @matthieugomez for implementing the "backend" and I am excited to see if I can smoothly implement the new gpu addition.
Hi Erik, I just tried it again.
Now it throws up a new error related to "@model not defined". I think the cause this time is pretty simple to diagnose: Matthieu recently changed the Julia syntax to "@formula".
I was going to create a separate issue, followed by a PR to fix this... but now I'm leaning towards your original idea of waiting a bit first. Things are changing swiftly enough on the Julia backend, that there may be more breaking changes on the way (at least in the short-run).
I'm happy for you to close this issue then, assuming you are too.
The macro model is just deprecated at this point, not undefined. So I don’t think this is the explanation for the error. Same thing for categorical btw.
On Wed, Oct 16, 2019 at 11:15 PM Grant McDermott [email protected] wrote:
Hi Erik, I just tried it again.
Now it throws up a new error related to "@model https://github.com/model not defined". I think the cause this time is pretty simple to diagnose: Matthieu recently changed the Julia syntax to "@formula https://github.com/formula".
I was going to create a separate issue, followed by a PR to fix this... but now I'm leaning towards your original idea of waiting a bit first. Things are changing swiftly enough on the Julia backend, that there may be more breaking changes on the way (at least in the short-run).
I'm happy for you to close this issue then, assuming you are too.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eloualiche/FixedEffectjlr/issues/4?email_source=notifications&email_token=ABPPPXMMGJ7LAZSSI5NQAQLQO7RGJA5CNFSM4I5G4IUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBOWO4Q#issuecomment-542992242, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPPPXKUGDP354KRFQQQJHDQO7RGJANCNFSM4I5G4IUA .