Skip to content

Commit

Permalink
pre-release edits
Browse files Browse the repository at this point in the history
  • Loading branch information
teanijarv committed Mar 3, 2024
1 parent 9983635 commit a08171c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
8 changes: 7 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ History
0.2.1 (2024-03-3)
------------------

* Option to modify the OLS parameters used in the HLR
* Option to modify the OLS parameters used in the HLR


0.2.2 (2024-03-3)
------------------

* Updated documentation
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ HLR is a simple Python package for running hierarchical linear regression.
It is built to work with Pandas dataframes, uses SciPy, statsmodels and pingouin under the hood, and runs diagnostic tests for testing assumptions while plotting figures with matplotlib and seaborn.

## Installation
HLR is meant to be used with Python 3.x and has been tested on Python 3.9-3.12.
HLR is meant to be used with Python 3.9 or above, and has been tested on Python 3.9-3.12.

#### Dependencies
- [NumPy](https://numpy.org/)
Expand All @@ -30,14 +30,14 @@ If you don’t have [pip](https://pip.pypa.io/) installed, this [Python installa

## Usage

Importing the module and running hierarchical linear regression and summarising the results.
Importing the module and running hierarchical linear regression, summarising the results, running assumption tests, and plotting.

```python
import pandas as pd
from HLR import HierarchicalLinearRegression

# Example dataframe which includes some columns which are also mentioned below
nba = pd.read_csv('example/NBA_train.csv')
nba = pd.read_csv('NBA_train.csv')

# Define the models for hierarchical regression including predictors for each model
X = {1: ['PTS'],
Expand All @@ -48,15 +48,15 @@ X = {1: ['PTS'],
y = 'W'

# Initiate the HLR object (missing_data and ols_params are optional parameters)
hreg = HierarchicalLinearRegression(df, X, y, missing_data='drop', ols_params=None)
hreg = HierarchicalLinearRegression(df, X, y, ols_params=None)

# Generate a summarised report of HLR
hreg.summary()

# Run diagnostics on all the models (displayed output below only shows the first model)
hreg.diagnostics(verbose=True)

# Different plots
# Different plots (see docs for more)
hreg.plot_studentized_residuals_vs_fitted()
hreg.plot_qq_residuals()
hreg.plot_influence()
Expand Down Expand Up @@ -129,15 +129,15 @@ Please use Zenodo DOI for citing the package in your work.

#### Example

Anijärv, T. E., Mitchell, J. and Boyle, R. (2024) ‘teanijarv/HLR: v0.2.1’. Zenodo. https://doi.org/10.5281/zenodo.7683808
Anijärv, T. E., Mitchell, J. and Boyle, R. (2024) ‘teanijarv/HLR: v0.2.2’. Zenodo. https://doi.org/10.5281/zenodo.7683808
```
@software{toomas_erik_anijarv_2024_7683808,
author = {Toomas Erik Anijärv, Jules Mitchell, Rory Boyle},
title = {teanijarv/HLR: v0.2.1},
title = {teanijarv/HLR: v0.2.2},
month = mar,
year = 2024,
publisher = {Zenodo},
version = {v0.2.1},
version = {v0.2.2},
doi = {10.5281/zenodo.7683808},
url = {https://doi.org/10.5281/zenodo.7683808}
}
Expand All @@ -151,7 +151,6 @@ This program is provided with no warranty of any kind and it is still under deve
#### To-do
Would be great if someone with more experience with packages would contribute with testing and the whole deployment process. Also, if someone would want to write documentation, that would be amazing.
- dict valus within df hard to read
- ability to change OLS parameters
- add t stats for coefficients
- give option for output only some columns not all
- add regression type option (eg, for logistic regression)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/teanijarv/HLR',
version='0.2.1',
version='0.2.2',
zip_safe=False,
)

0 comments on commit a08171c

Please sign in to comment.