lrberge / fixest

Fixed-effects estimations
https://lrberge.github.io/fixest/
361 stars 59 forks source link

fixest v0.12.0: Error in cat_magic when running feols #490

Closed mojihelen closed 2 months ago

mojihelen commented 2 months ago

Trying feols for the first time using the example iris dataset from the Website. Received attached error message regarding cat_magic. Running R version 4.1.2 on Ubuntu server.

OLS estimation, Dep. Var.: Sepal.Length
Error: in cat_magic(..., .sep = .sep, .end = .end, .width = ...:
'string_magic' requires at least one character scalar to work.
Named arguments are only used as variables on which to apply interpolation.
FIX: please provide at least one non-named argument. 

Please advise how to resolve this, thanks!

R_Error
etiennebacher commented 2 months ago

I can't reproduce this on R 4.3. Can you also show the version of stringmagic and dreamerr and update them if they are outdated?

packageVersion("fixest")
#> [1] '0.12.0'
packageVersion("stringmagic")
#> [1] '1.1.0'
packageVersion("dreamerr")
#> [1] '1.4.0'

fixest::feols(Sepal.Length ~ Sepal.Width, iris)
#> OLS estimation, Dep. Var.: Sepal.Length
#> Observations: 150
#> Standard-errors: IID 
#>              Estimate Std. Error  t value  Pr(>|t|)    
#> (Intercept)  6.526223   0.478896 13.62763 < 2.2e-16 ***
#> Sepal.Width -0.223361   0.155081 -1.44029    0.1519    
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 0.819578   Adj. R2: 0.007159
mojihelen commented 2 months ago

Ubuntu Version 20.04.4 LTS Versions of stringmagic and dreamerr seem ok

Screenshot 2024-04-25 113546
lrberge commented 2 months ago

Rhoooo, nooo. I'm sorry. Dependency hell pointing its nose. I'll try to fix asap.

lrberge commented 2 months ago

Hmm, I cannot replicate with R 4.0.2 on Debian.

Can you run:

library(dreamerr) ; library(fixest)
setDreamerr_show_stack(TRUE)
est = feols(Sepal.Length ~ Sepal.Width, iris)
print(est)
mojihelen commented 2 months ago

We have resolved the issue by upgrading to the latest R version:

Screenshot 2024-04-25 192012

Before that I had tried reinstalling the fixest package and I noticed there was a message regarding a previous package I had installed:

test

But deinstalling the package coin did not solve the issue..so not sure if it is related, but realized some packages previously installed must be causing the issue, thus decided to reinstall R.

Thank you so much for the quick help and support!

lrberge commented 2 months ago

The R namespace management is strict and the results should not depend on the loading of other packages (actually it can, but not for the reported problem). I'm happy upgrading the R version solved the problem, although this is an inconvenience and far from optimal.

Since it's very likely that other users experience this problem following the new version of fixest, I'm leaving the issue open for information purposes.

Thanks for reporting.

lrberge commented 2 months ago

Solved, see #494 Thanks again for swiftly reporting!