Metadata-Version: 2.1
Name: regression-graph
Version: 2
Summary: Python library for regression graphs using coefficents, confidence intervals and p-values
Author: Saema Khanom
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE

**README.md:**
```markdown
# Regression Graph

## Overview 

This Python library was designed to create regression graphs for datasets. Instead of using p-values, this library will use the coefficients and confidence interval to plot bars for each variable in the given dataset. The bars will be plotted with their upper and lower confidence interval and will use the p-value for the saturation of the bars. There's optional arguments to standardize the dataset. A table can be created to display the variable, mean and standard deviation of the dataset. 

## Features 

plot_graph: plot the regression graph with manual data or with statsmodel regression

coefficient_distribution_plots: plot any scipy distrabutions

create_table: create a table for the variables, mean and standard deviation

extract_data: use the statsmodel library to pass a fitted regression model which will extact the coefficents, confidence interval and p-value from the model and pass it onto plot_graph to produce the graph. 

regression_plot, call this function and either inpur manaul dataset or statsmodels regression model to produce the graph. This function will either call extract_model if a regression is passed or plot_graph if manual data is passed. Call create_table to produce a table with the variable name, mean and standard devisation of the values. 

## Installation

Install the package using pip install regression_graph

## Example usage 

```python
from regression_graph import regression_plot
```

## Statsmodel
1. Read file path file
2. Remove rows with missing values
3. select the dependent variable (y) and independent variables (X)
4. Fit the regression model
5. Give variable names for the y-axis eg x
6. Plot the regression coefficients with confidence intervals
Call regression_plot(ax1, model_result=model, variable_names=variable_names,
                positive_bar_colour=none, negative_bar_colour=none, title) 
7. Optional table
create_table(ax2=position, dataframe, loc=none, font_size=none, col_widths=none,
             label_cell_loc=none, label_bbox=mandatory)

## Manual input
1. Provide the coefficients, confidence intervals upper and lower bounds, and p-values
2. Call regression_plot
regression_plot(ax1, model_result=model, variable_names=X_cols)
3. Optional table
create_table(ax2=position, dataframe, loc=none, font_size=none, col_widths=none,
             label_cell_loc=none, label_bbox=mandatory)

Both options allow the values to be standardize by doing standardize=True in the regression_plot argument. 
If standardize=True then user is required to give an input_X value (this is the indepdenat variable, can be a column from the dataset) for the function to work. 

# Coefficent distrabution
1. Read file path file
2. Remove rows with missing values
3. select the dependent variable (y) and independent variables (X)
4. Fit the regression model
5. Give variable names for the y-axis eg x
6. Give manual values for coefficents, p-values, std_errs or pass a model to get the values. 
7. Use scipy to pass a distrabution 
8. Call regression_plot
(ax1, coefficients=coefficients, distribution=distribution, p_values=p_values)
9. Optional Paramter for Table
10. Show graph

# Create Table
1. Call create_table
2. Provide a paramter for data (independant variable)
3. Optional paramter to change table size and text.

# Customisable options 
Plot_graph
1. xlabel
2. title
3. show_yticks
4. custom_levels
5. positive_colour, negstive_colour

coefficient_distribution_plots
1. same as plot_graph with these additional optiond
2. distribution
3. num_std
4. lower_percentile, upper_percentile

create_table 
1. data
2. dependent_variable
3. loc
4. cell_loc
5. font_size
6. bbox
7. col_widths
8. label_cell_loc
9. labels_bbox

regression_plot
table_kwargs

## Requirements
Python 3.6 and above
Numpy
Matplotlib
Pandas
Statsmodels (optional)

## License 
This project is licensed under MIT, view license here - https://choosealicense.com/licenses/mit/

## Contact 

Please feel free to leave any feedback or questions here: saemakhanom@gmail.com
```
