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

fixef doesn't handle integer variables on varying slopes #20

Closed
clerousset opened this issue May 14, 2020 · 2 comments
Closed

fixef doesn't handle integer variables on varying slopes #20

clerousset opened this issue May 14, 2020 · 2 comments

Comments

@clerousset
Copy link

@clerousset clerousset commented May 14, 2020

Hi (bonjour),

fixef returns an error when the varying slope variable is an integer. See the code below :
##your example
base_vs = iris
names(base_vs) = c(paste0("x", 1:4), "species")
est_vs = feols(x1 ~ x2 | species[x3], base_vs)
fixef(est_vs)
##the example which leads to an error
base_vs$x4=as.integer(base_vs$x3)
est_vs = feols(x1 ~ x2 | species[x4], base_vs)
fixef(est_vs)
##one way to solve it
base_vs$x5=as.numeric(as.integer(base_vs$x3))
est_vs = feols(x1 ~ x2 | species[x5], base_vs)
fixef(est_vs)

Bonne journée,

@lrberge
Copy link
Owner

@lrberge lrberge commented May 14, 2020

Et bonjour,

Thanks for this very neat bug report!

I've solved it in fixef (one as.numeric was missing as you pointed out), but I didn't push yet to GH. Currently I'm making major changes and the GH version is unstable. Of interest to you, these changes include a (much) faster estimation + greater numerical accuracy when varying slopes are present.
But it's big changes and I don't know when I'll be able to gather the time to do it all. Confinement, etc...

If you're OK, I'll close the issue when I manage to make a stable GH version.

Merci et bonne journée à toi aussi !

@lrberge
Copy link
Owner

@lrberge lrberge commented Jun 9, 2020

The new version (0.5.0) should soon come to CRAN. The current GH version is stable.

I didn't have the time to implement the varying slopes stuff (I had many other cats to whip [I don't know if this expression translates well in English]), it will be for the next release. But, for the record, estimations are now much much faster when factors (including varying slopes) are treated as regular variables (and not in the fixed-effects part).

Thanks again for the report!

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.