MyNixOS website logo
Description
Fast Fixed-Effects Estimations
Fast and user-friendly estimation of econometric models with multiple fixed-effects. Includes ordinary least squares (OLS), generalized linear models (GLM) and the negative binomial. The core of the package is based on optimized parallel C++ code, scaling especially well for large data sets. The method to obtain the fixed-effects coefficients is based on Berge (2018) <https://github.com/lrberge/fixest/blob/master/_DOCS/FENmlm_paper.pdf>. Further provides tools to export and view the results of several estimations with intuitive design to cluster the standard-errors.

fixest: Fast and user-friendly fixed-effects estimation

CRAN status Version_ROpensci Version Downloads

The fixest package offers a family of functions to perform estimations with multiple fixed-effects in both an OLS and a GLM context. Please refer to the introduction for a walk-through.

At the time of writing of this page (February 2020), fixest is the fastest existing method to perform fixed-effects estimations, often by orders of magnitude. See below for a benchmarking with the fastest alternative software.

# To install from CRAN:
install.packages("fixest")

# To install the latest stable development release:
install.packages("fixest", 
                 repos = c(ropensci = 'https://fastverse.r-universe.dev',
                           CRAN = 'https://cloud.r-project.org'))

Benchmarking

Here is a comparison of the performance of fixest functions to other state of the art methods to perform estimations with multiple fixed-effects. The results are reported in the five figures below. Package fixest (black lines) is consistently faster in all situations.

Setup

The benchmarking was performed as follows: In the OLS context, we estimate the following equation:

The same functional form (one variable, three fixed-effects) is estimated for the Poisson, the Negative Binomial and the Logit cases (with ad hoc modifications to fit each model). See Berge (2018) for more details on the setup.

For the "difficult" benchmark (OLS only), the data is generated in a way that makes the convergence of the fixed-effects slow. The phenomenon of slow convergence is frequent for real micro-level data sets involving employee and firm fixed-effects for instance.

Each estimation is replicated 10 times and the average computing time is reported in the figures.

The alternative methods used for comparison are:

  • OLS: felm (R: package lfe), reghdfe (Stata) and FixedEffectModels (Julia)
  • Poisson: glmmboot (R: package glmmML), feglm (R: package alpaca) and ppmlhdfe (Stata)
  • Negative Binomial: glm.nb (R: package MASS) and nbreg (Stata)
  • Logit: glmmboot (R: package glmmML), feglm (R: package alpaca) and logit (Stata)

All the aforementioned packages were updated at the benchmarking date: February 2020.

The code and data for the benchmarking can be found in this folder.

Acknowledgements

Of course the development of fixest has been inspired and pushed forward by (almost all) these (great) packages used in the benchmarking and I am deeply indebted to their authors. Although fixest contains many features, some are still uncovered and you should definitely have a look at these packages.

Metadata

Version

0.12.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows