Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined variable error: categorical not defined #4

Open
grantmcdermott opened this issue Oct 3, 2019 · 6 comments
Open

Undefined variable error: categorical not defined #4

grantmcdermott opened this issue Oct 3, 2019 · 6 comments

Comments

@grantmcdermott
Copy link

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)

@eloualiche
Copy link
Member

eloualiche commented Oct 3, 2019

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

@eloualiche
Copy link
Member

I believe b1dbb07 closes it.
It had to do with the change in FE.

@grantmcdermott
Copy link
Author

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.

@eloualiche eloualiche reopened this Oct 8, 2019
eloualiche added a commit that referenced this issue Oct 8, 2019
…l commands have been upgraded (Interactive)
@eloualiche
Copy link
Member

eloualiche commented Oct 8, 2019

I hope ca07e4b 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.

@grantmcdermott
Copy link
Author

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.

@matthieugomez
Copy link
Member

matthieugomez commented Oct 17, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants