Skip to content

add an example for etable #909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/table-layout.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,20 @@ fit8 = pf.feols("Y ~ X1 + X2 + job*X2", data = data)

pf.etable([fit7, fit8], labels=labels, cat_template="{value}")
```
## Change reference category
You can also change the reference category of a categorical variable using the `ref` argument in the interaction `i()` operator. For example, repeating the last estimation but changing the reference category to "Managerial" instead of "Admin":

```{python}

fit9 = pf.feols("Y ~ X1 + X2 + i(job,ref='Managerial') + i(job,X2,ref='Managerial')", data = data)

pf.etable([fit9], labels=labels, cat_template="{value}")
```

Notice that this process will change the `_coefnames`. In this example, the new `_coefnames` are:
```{python}
fit9._coefnames
```

## Custom model headlines
You can also add custom headers for each model by passing a list of strings to the `model_headers` argument.
Expand Down
Loading