class arpoon.rfixest.Fixest

Main class to interact with r-fixest

Example: initialize a Fixest object, with trade data
In [1]: import arpoon as ar

In [2]: data = ar.rpytools.r_data.load("trade", "fixest")

In [3]: data
Out[3]: 
shape: (38_325, 6)
┌─────────────┬────────┬─────────┬────────┬─────────────┬─────────────┐
│ Destination ┆ Origin ┆ Product ┆ Year   ┆ dist_km     ┆ Euros       │
│ ---         ┆ ---    ┆ ---     ┆ ---    ┆ ---         ┆ ---         │
│ cat         ┆ cat    ┆ i32     ┆ f64    ┆ f64         ┆ f64         │
╞═════════════╪════════╪═════════╪════════╪═════════════╪═════════════╡
│ LU          ┆ BE     ┆ 1       ┆ 2007.0 ┆ 139.571939  ┆ 2.966697e6  │
│ BE          ┆ LU     ┆ 1       ┆ 2007.0 ┆ 139.571939  ┆ 6.75503e6   │
│ LU          ┆ BE     ┆ 2       ┆ 2007.0 ┆ 139.571939  ┆ 5.7078782e7 │
│ BE          ┆ LU     ┆ 2       ┆ 2007.0 ┆ 139.571939  ┆ 7.117406e6  │
│ LU          ┆ BE     ┆ 3       ┆ 2007.0 ┆ 139.571939  ┆ 1.7379821e7 │
│ …           ┆ …      ┆ …       ┆ …      ┆ …           ┆ …           │
│ FI          ┆ PT     ┆ 18      ┆ 2016.0 ┆ 3542.362784 ┆ 56.0        │
│ PT          ┆ FI     ┆ 19      ┆ 2016.0 ┆ 3542.362784 ┆ 224842.0    │
│ FI          ┆ PT     ┆ 19      ┆ 2016.0 ┆ 3542.362784 ┆ 212957.0    │
│ PT          ┆ FI     ┆ 20      ┆ 2016.0 ┆ 3542.362784 ┆ 874663.0    │
│ FI          ┆ PT     ┆ 20      ┆ 2016.0 ┆ 3542.362784 ┆ 2.831518e6  │
└─────────────┴────────┴─────────┴────────┴─────────────┴─────────────┘

# initialize a Fixest object
In [4]: fixest = ar.rfixest.Fixest(data=data)

In [5]: fixest
Out[5]: Fixest

Constructors

Fixest(data, ...)

Estimation

feols(fml: str, vcov: str = None, ...) FixestOLS

Estimates OLS with any number of fixed-effects, by calling r-fixest feols

feglm(fml: str, family: str = 'gaussian', ...) FixestGLM

Estimates GLM models with any number of fixed-effects, by calling r-fixest feglm

femlm(fml=None, family=None, vcov=None, ...) FixestNMLM

Call r-fixest femlm

fenegbin(fml=None, vcov=None, theta_init=None, ...) FixestNMLM

Call r-fixest fenegbin

feNmlm(fml: str, family: str = None, NL_fml=None, ...) FixestNMLM

Call r-fixest feNmlm

fepois(fml: str, vcov: str = None, ...) FixestGLM

Call r-fixest feglm with family set to ‘poisson’

Results

coeftable(keep: str = None, drop: str = None, ...)

Methods to extracts the coefficients table and its sub-components from an estimation.

etable(*keys, ...) list | str | pandas.core.frame.DataFrame

Estimations table (export the results of multiples estimations to a DF or to Latex)

Methods

clear_cache()

Clears the cache storing objects returned by the estimation methods.

fitstat(type_: str | list = None, simplify=False, verbose=True, ...)

Fit Statistics

get_columns_in_formula(...) dict[str, str] | list[str]

Get the list of columns lised in the formula

get_data(r: bool = False, est_sample: bool | str = False)

Returns the relevant data.

get_metadata(key: str = None, columns: list | str = None, ...)
classmethod r_globalenv(symbol: str | Iterable = None, ...) None
r_schema(type_of: bool = False)

Info

fixef_vars(combine: bool = True) dict[str | tuple[str, str], str]

Name of the fixed-effect columns.

Export

to_marginal_effects()

Get arpoon.rmarginaleffects.MarginalEffects object