Skip to main content

A simple wrapper for linearmodels to generate clean panel regression tables in LaTeX.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solargazer-0.2.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

solargazer-0.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file solargazer-0.2.tar.gz.

File metadata

  • Download URL: solargazer-0.2.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.5

File hashes

Hashes for solargazer-0.2.tar.gz
Algorithm Hash digest
SHA256 98bae490378b3861f3eba723ef6b926c5cedaf69e0d5014ba2d5a6e5ff73c888
MD5 e263cab4011d654aec4cf1761d290c90
BLAKE2b-256 65ce0f21f7a73db97e11a62cb8775c9b4f1c725ca20ff6a963e3c9c2ceec974e

See more details on using hashes here.

File details

Details for the file solargazer-0.2-py3-none-any.whl.

File metadata

  • Download URL: solargazer-0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.5

File hashes

Hashes for solargazer-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7d92a373c3e5a3fd10ef6a8beff64ff75f3b7f3cb8936535416bc5054931a7fe
MD5 11cf2fd22db14568a0209f0f5280a793
BLAKE2b-256 edc59accc585379fd572cba0ab8edc7fa2c106143ed9b0fb2c0db0b9d2d0e195

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page