CLI API Reference¶
Entry Point
Command: panelbox
Source: panelbox/cli/
Overview¶
PanelBox provides a command-line interface for quick model estimation and data inspection without writing Python code. The CLI supports all static panel models, GMM estimators, and multiple covariance types.
| Command | Description |
|---|---|
panelbox estimate |
Estimate a panel model from a data file |
panelbox info |
Display data or results information |
panelbox estimate¶
Estimate a panel model from a CSV data file.
Required Arguments¶
| Argument | Description | Example |
|---|---|---|
--data FILE |
Path to CSV data file | --data panel.csv |
--model TYPE |
Model type | --model fe |
--formula FORMULA |
R-style formula | --formula "invest ~ value + capital" |
--entity COL |
Entity column name | --entity firm |
--time COL |
Time column name | --time year |
Optional Arguments¶
| Argument | Default | Description |
|---|---|---|
--output FILE, -o |
— | Save results to file |
--cov-type TYPE |
nonrobust |
Covariance type (see table below) |
--format FORMAT |
pickle |
Output format: pickle or json |
--verbose, -v |
— | Print verbose output |
--no-summary |
— | Skip printing the summary table |
Model Types¶
| Value | Model |
|---|---|
pooled |
Pooled OLS |
fe |
Fixed Effects |
re |
Random Effects |
between |
Between Estimator |
fd |
First Difference |
diff_gmm |
Difference GMM |
sys_gmm |
System GMM |
Covariance Types¶
| Value | Description |
|---|---|
nonrobust |
Standard (default) |
robust |
HC1 robust |
hc0, hc1, hc2, hc3 |
Heteroskedasticity-consistent |
clustered |
Clustered by entity |
twoway |
Two-way clustered |
driscoll_kraay |
Driscoll-Kraay |
newey_west |
Newey-West HAC |
pcse |
Panel-corrected SE |
Examples¶
# Basic fixed effects estimation
panelbox estimate \
--data investment.csv \
--model fe \
--formula "invest ~ value + capital" \
--entity firm \
--time year
# With robust standard errors, save results
panelbox estimate \
--data investment.csv \
--model fe \
--formula "invest ~ value + capital" \
--entity firm \
--time year \
--cov-type robust \
--output results.pkl
# Random effects with clustered SE
panelbox estimate \
--data panel.csv \
--model re \
--formula "y ~ x1 + x2 + x3" \
--entity id \
--time period \
--cov-type clustered \
--verbose
# Difference GMM
panelbox estimate \
--data employment.csv \
--model diff_gmm \
--formula "n ~ w + k | L.n" \
--entity id \
--time year
panelbox info¶
Display information about a dataset or saved model results.
Arguments¶
| Argument | Description |
|---|---|
--data FILE |
Path to CSV data file (mutually exclusive with --results) |
--results FILE |
Path to saved results file (.pkl) (mutually exclusive with --data) |
--entity COL |
Entity column (for --data mode) |
--time COL |
Time column (for --data mode) |
--verbose, -v |
Print verbose output |
Examples¶
# Inspect a data file
panelbox info --data panel.csv --entity firm --time year
# Inspect saved results
panelbox info --results results.pkl --verbose
Data Info Output¶
When using --data, the output includes:
- Number of observations, entities, and time periods
- Panel balance (balanced/unbalanced)
- Variable statistics (mean, std, min, max)
- Missing values per column
Results Info Output¶
When using --results, the output includes:
- Model type and formula
- Coefficient estimates and standard errors
- Fit statistics (R², AIC, BIC)
- Diagnostic test results (if available)
Integration with Python API¶
The CLI is designed for quick analyses. For full control, use the Python API:
The Python API provides access to:
- All model types (70+)
- Validation and diagnostic tests
- Visualization and report generation
- Result serialization and loading
See Also¶
- Getting Started — installation and first steps
- Static Models API — full Python model API
- Datasets API — built-in datasets