Skip to main content

Applied Econometrics Library for Python

Project description

# appelpy: Applied Econometrics Library for Python

## About 👁️ appelpy is the __*Applied Econometrics Library for Python*__. It seeks to bridge the gap between the software options that have a simple syntax (such as Stata) and other powerful options that use Python’s object-oriented programming as part of data modelling workflows. ⚗️

Econometric modelling and general regression analysis in Python have never been easier!

The library builds upon the functionality of the ‘vanilla’ Python data stack (e.g. Pandas, Numpy, etc.) and other libraries such as Statsmodels.

### 🥧 Why it’s as easy as pie Here is a flavour of a basic OLS regression done through appelpy, supposing you have [data](https://econpapers.repec.org/paper/bocbocins/caschool.htm) sitting in a Pandas dataframe df and want to model the dependent variable api00 on three other variables: `python from appelpy.linear_model import OLS model1 = OLS(df, ['api00'], ['acs_k3', 'meals', 'full']) model1.results_output # returns summary results ` The key information is sitting in the model1 object, but there is much more functionality that can be done with it. These are more things that can be done via one line of code: - Diagnostics can be called from the object: e.g. produce a P-P plot via model1.diagnostic_plot(‘pp_plot’) - Model selection statistics: e.g. find the root mean square error of the model from model1.model_selection_stats - Standardized model estimates: model1.results_output_standardized

### 🍏 What inspired it? 1) The simple syntax of software such as Stata. With the data loaded, a regression model summary can be returned by a one-line command:

`stata regress api00 acs_k3 meals full ` However with the simplicity comes a few disadvantages: it is not open-source software; the workflows are tricky with modern business problems; lacks the benefits of object-oriented programming.

  1. Statsmodels is a powerful Python library that addresses some of those disadvantages, but with that power comes a considerable learning curve and clunkiness. Here is the code for the same regression:

`python import statsmodels.api as sm model1 = sm.OLS(df['api00'], sm.add_constant(df['acs_k3', 'meals', 'full'])).fit() results1 = model1.summary() # returns summary results ` It can get much more unwieldy than that. The model results object is brilliant as it can be printed in different formats (plaintext, Latex, etc.)… but that is only the starting point. How do I diagnose the regression model itself? How do I get standardized estimates? That’s where it becomes more complicated.

appelpy simply wants to achieve a sweet spot between both approaches.

## Installation ⏲️ pip install appelpy

## Dependencies 🖇️ - pandas>=0.24 - scipy - numpy - statsmodels - patsy - seaborn - matplotlib

## Licence ⚖️ Modified BSD (3-clause)

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

appelpy-0.0.1.tar.gz (13.6 kB view details)

Uploaded Source

File details

Details for the file appelpy-0.0.1.tar.gz.

File metadata

  • Download URL: appelpy-0.0.1.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for appelpy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ee81e7be86835faecc50fdf755e104458257ff0fc72d1bdc323b4198b0cdcdb9
MD5 ff76dfea7cb91fbc4fdeee24db539c11
BLAKE2b-256 c0bc2ced9a93a091a87b8e62c63a32440f7163acdb2a656b4408ebc50787a577

See more details on using hashes here.

Supported by

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