famafrench.utils.get_statsTable

famafrench.utils.get_statsTable(dType, dFreq, df, dates_as_index=True, ptiles=None)[source]

Construct detailed tables with summary statistics.

Parameters
  • dType (str) –

    Dataset type of the portfolios. Possible choices are:

    • Returns

    • Factors

    • NumFirms

    • Characs

  • dFreq (str) –

    Observation frequency of the portfolios. Possible choices are:

    • D : daily

    • W : weekly

    • M : monthly

    • Q : quarterly (3-months)

    • A : annual

  • df (pandas.DataFrame) – Dataset w/ portfolio returns (which may include factor returns), number of firms in each portfolio, or average anomaly portfolio characteristics for a given portfolio sorting strategy.

  • dates_as_index (bool) – Flag determining whether df has a pandas.DatetimeIndex index (dates_as_index = True). Otherwise, dates_as_index = False.

  • ptiles (list, float, default None) – List of percentiles (in decimal format) included as part of output results. If None, then ptiles = [0.01, 0.1, 0.25, 0.5, 0.75, 0.9, 0.99].

Returns

statsTable

Summary statistics of the dataset including the following:

If dates_as_index = True, then the table also includes the starting and ending date for each observation type.

Return type

pandas.DataFrame