Skip to content

Conversation

@etiennebacher
Copy link
Member

@etiennebacher etiennebacher commented Mar 16, 2023

fixest has a great interface to make multiple estimations in the same function call. It returns an object of class fixest_multi which is basically a list of fixest objects.

This PR adds support for fixest_multi for the following functions: check_outliers(), check_overdispersion(), r2(), model_performance().

Important: there were some discussion in #429 about which checks should be implemented for this package. I only looked at the functions supporting fixest and added support for fixest_multi, that's it (+ a few tests)

Examples:

library(performance)
library(fixest)
#> 
#> Attachement du package : 'fixest'
#> L'objet suivant est masqué depuis 'package:performance':
#> 
#>     r2

base <- iris
names(base)  <- c("y1", "y2", "x1", "x2", "species")
res <- feols(c(y1, y2) ~ x1 + csw(x2, x2^2) | species, base)
model_performance(res)
#> $`lhs: y1; rhs: x1 + x2`
#> # Indices of model performance
#> 
#> AIC     |     BIC |    R2 | R2 (adj.) | R2_within | R2_within_adjusted |  RMSE | Sigma
#> --------------------------------------------------------------------------------------
#> 106.231 | 121.284 | 0.837 |     0.832 |     0.572 |              0.566 | 0.333 | 0.339
#> 
#> $`lhs: y1; rhs: x1 + x2 + I(x2^2)`
#> # Indices of model performance
#> 
#> AIC     |     BIC |    R2 | R2 (adj.) | R2_within | R2_within_adjusted |  RMSE | Sigma
#> --------------------------------------------------------------------------------------
#> 107.743 | 125.807 | 0.837 |     0.832 |     0.573 |              0.564 | 0.333 | 0.340
#> 
#> $`lhs: y2; rhs: x1 + x2`
#> # Indices of model performance
#> 
#> AIC    |    BIC |    R2 | R2 (adj.) | R2_within | R2_within_adjusted |  RMSE | Sigma
#> ------------------------------------------------------------------------------------
#> 65.423 | 80.476 | 0.551 |     0.539 |     0.251 |              0.240 | 0.291 | 0.296
#> 
#> $`lhs: y2; rhs: x1 + x2 + I(x2^2)`
#> # Indices of model performance
#> 
#> AIC    |    BIC |    R2 | R2 (adj.) | R2_within | R2_within_adjusted |  RMSE | Sigma
#> ------------------------------------------------------------------------------------
#> 66.637 | 84.701 | 0.553 |     0.538 |     0.255 |              0.239 | 0.290 | 0.296

@etiennebacher
Copy link
Member Author

Failures seem unrelated (happen in test-cronbachs_alpha)

@strengejacke
Copy link
Member

There will be a lot of failures in tests, because some functions rely on changes in upstream packages (inisght, parameters), which will resolve after this release cycle.

@strengejacke strengejacke merged commit aa927ac into main Mar 16, 2023
@strengejacke strengejacke deleted the fixest_multi branch March 16, 2023 21:04
@strengejacke
Copy link
Member

Thanks! We may think of adding an additional class for specific print-methods, but the printed lists already look quite ok for now.

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

Successfully merging this pull request may close these issues.

3 participants