Skip to main content

SolarGazer: A Simple Panel Regressions Wrapper for Latex Tables in Python

Description

solargazer is an extremely simple library designed to offer additional functionalities relative to stargazer for Latex table generation in Python. The library is compatible with the PanelOLS class from statsmodels for clean tables in Latex.

IMPORTANT: Follow this Colab tutorial notebook for the easiest setup guide: https://colab.research.google.com/drive/1s9IpYR2xxvgrQBbqTk9GKFTPutxAgMMU?usp=sharing

Installation

Installation is extremely simple using pip. If you are using this to make regression tabels, you will need to have linearmodels installed. Open your terminal or command prompt and run:

pip install linearmodels

Then you can install solargazer using:

pip install solargazer

To run the tables in Latex, you will also need to include this in your preamble:

\usepackage{amssymb}
\usepackage{threeparttable}
\usepackage{booktabs}

Use

There is only one simple function.

from solargazer.solargazer import SolarGazer
SolarGazer().make_table(model_list,model_names, groupings = group_dict)

The function takes three parameters.

  1. model_list: a list of your fitted PanelOLS models. This is post-processing, etc.
  2. model_names: a list of strings which are the names you want for the columns in your regressions.
  3. grouping: an optional dictionary to add groupings at the top of the regression table, if you want to make clear that several of the regressions are of the same type. If you don't provide a dictionary here, there will be no additional title at the top, just the model names.

So a full example might be:

SolarGazer().make_table([model1, model2, model3],['model 1','model 2','model 3'], groupings = {'Republican':[model1, model2],'Democratic':[model3]})

The library will output a LateX string that you can directly transfer to your file.

Release files for solargazer 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solargazer 0.2
File Size Uploaded
solargazer-0.2.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for solargazer 0.2
File Interpreter ABI Platform
solargazer-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / solargazer-0.2.tar.gz

Download URL solargazer-0.2.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
98bae490378b3861f3eba723ef6b926c5cedaf69e0d5014ba2d5a6e5ff73c888
BLAKE2b-256 checksum
How to use checksums
65ce0f21f7a73db97e11a62cb8775c9b4f1c725ca20ff6a963e3c9c2ceec974e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.5

Release files / solargazer-0.2-py3-none-any.whl

Download URL solargazer-0.2-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d92a373c3e5a3fd10ef6a8beff64ff75f3b7f3cb8936535416bc5054931a7fe
BLAKE2b-256 checksum
How to use checksums
edc59accc585379fd572cba0ab8edc7fa2c106143ed9b0fb2c0db0b9d2d0e195
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page