Skip to content

Add number of clusters to model_stats for pyfixest models? #26

@leostimpfle

Description

@leostimpfle

Would it make sense to add the number of clusters to model_stats for pyfixest models? Context is that in panel data settings it is very common to cluster at the unit level and it usually is relevant to know not just the total number of observations but also the number of units in the panel.

I can achieve the desired outcome using custom_model_stats as below but was wondering if this is common enough to warrant supporting it directly in model_stats?

import numpy as np
import pyfixest as pf
import maketables as mt

data = pf.get_data(N=1_000, seed=0, model="Fepois")
data["sample"] = np.random.choice([True, False], data.shape[0])
fit = pf.fepois(fml="Y ~  X2 | f1", data=data, vcov={"CRV1": "sample"})
mt.ETable(fit, custom_model_stats={"Clusters": fit._G[0]})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions