import pyfixest as pf
# load data
df = pf.get_data()
pf.dtable(df, vars = ["Y", "X1", "X2", "f1"])| N | Mean | Std. Dev. | |
|---|---|---|---|
| Y | 999.00 | -0.13 | 2.30 |
| X1 | 999.00 | 1.04 | 0.81 |
| X2 | 1,000 | -0.13 | 3.05 |
| f1 | 999.00 | 14.21 | 8.70 |
Generate descriptive statistics tables and create a booktab style table in the desired format (gt or tex).
.. deprecated:: 0.41.0 This function is deprecated and will be removed in a future version. Please use maketables.DTable() directly instead. See https://py-econometrics.github.io/maketables/ for documentation.
| Name | Type | Description | Default |
|---|---|---|---|
| df | pd.DataFrame | DataFrame containing the table to be displayed. | required |
| vars | list | List of variables to be included in the table. | required |
| stats | list | List of statistics to be calculated. The default is None, that sets [‘count’,‘mean’, ‘std’]. All pandas aggregation functions are supported. | None |
| bycol | list | List of variables to be used to group the data by columns. The default is None. | None |
| byrow | str | Variable to be used to group the data by rows. The default is None. | None |
| type | str | Type of table to be created. The default is ‘gt’. Type can be ‘gt’ for great_tables, ‘tex’ for LaTeX or ‘df’ for dataframe. | 'gt' |
| labels | dict | Dictionary containing the labels for the variables. The default is None. | None |
| stats_labels | dict | Dictionary containing the labels for the statistics. The default is None. The function uses a default labeling which will be replaced by the labels in the dictionary. | None |
| digits | int | Number of decimal places to round the statistics to. The default is 2. | 2 |
| notes | str | Table notes to be displayed at the bottom of the table. | '' |
| counts_row_below | bool | Whether to display the number of observations at the bottom of the table. Will only be carried out when each var has the same number of obs and when byrow is None. The default is False | False |
| hide_stats | bool | Whether to hide the names of the statistics in the table header. When stats are hidden and the user provides no notes string the labels of the stats are listed in the table notes. The default is False. | False |
| kwargs | dict | Additional arguments to be passed to maketables.DTable. | {} |
| Name | Type | Description |
|---|---|---|
| A table in the specified format. |
For more examples, take a look at the regression tables and summary statistics vignette.