Skip to content

Commit

Permalink
ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
segemart committed Jun 18, 2024
1 parent 5115823 commit 065e2b1
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 12 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Statsmed

Statsmed is designed to perform statistical analysis of medical data, but may also be used for various datasets. It gives you an fast overview of your data and allows you to perform test and create figures.
There are examples for some functions.

- [Example 1](https://github.com/segemart/statsmed/blob/main/examples/example1/Tests_normal_distribution.ipynb) - Test for normal distribution
- [Example 2](https://github.com/segemart/statsmed/blob/main/examples/example2/DescriptiveStatistic.ipynb) - Descriptive Statistic - Mean; Confidence Interval - Median; Inter-quartile range
- [Example 3](https://github.com/segemart/statsmed/blob/main/examples/example3/Correlations.ipynb) - Pearson's and Spearman's correlation with figures
- [Example 4](https://github.com/segemart/statsmed/blob/main/examples/example4/Comparision_continuous.ipynb) - Comparison of two groups with continuous variables
- [Example 5](https://github.com/segemart/statsmed/blob/main/examples/example5/Bland-Altman-Plots.ipynb) - Bland-Altman plots

### Installation

Statsmed works on Ubuntu, Mac, and Windows and on CPU and GPU.

Please make sure you have a running version of Python (>= 3.8.8), pip and git.

Install Statsmed
```
pip install git+https://github.com/segemart/statsmed.git
```


### Usage

Statsmed also allows you to generate figures quickly. See for example [Example 3](https://github.com/segemart/statsmed/blob/main/examples/example3/Correlations.ipynb) or [Example 5](https://github.com/segemart/statsmed/blob/main/examples/example5/Bland-Altman-Plots.ipynb), where we generated plots to show some correlations and Bland-Altman plots.

![Correlations](examples/example3/Corr_subplots.png)

![Bland-Altman plots](examples/example3/Corr_subplots.png)
Binary file added examples/example3/Corr_subplots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/example3/Corr_subplots.tiff
Binary file not shown.
14 changes: 7 additions & 7 deletions examples/example3/Correlations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -96,7 +96,7 @@
" [ 0. , 0.12 , 0. , 0.06 , 0.17 ]])"
]
},
"execution_count": 1,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -140,7 +140,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -169,7 +169,7 @@
" [0. , 0.35, 0. , 0.25, 0.44]])"
]
},
"execution_count": 2,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -188,7 +188,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -218,7 +218,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -278,7 +278,7 @@
"statsmed.corr_scatter_figure(data['age'][data['iliopsoas_left_volume'] >= 10],data['iliopsoas_left_volume'][data['iliopsoas_left_volume'] >= 10]/1000,x4,'Left Iliopsoas','Age in years','Volume of left Iliopsoas (ml)',color = 'blue')\n",
"plt.gcf().subplots_adjust(bottom=0.15)\n",
"plt.tight_layout()\n",
"plt.savefig('Corr_subplots.tiff',transparent=False) # saves the figure\n"
"plt.savefig('Corr_subplots.png',transparent=False) # saves the figure\n"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions examples/example5/Bland-Altman-Plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Example 5 - Bland Altman plots"
"### Example 5 - Bland-Altman plots"
]
},
{
Expand All @@ -27,7 +27,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -67,7 +67,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -106,7 +106,7 @@
"statsmed.bland_altman_plot(new_data_left_iliopsoas['iliopsoas_left_volume_R1'],new_data_left_iliopsoas['iliopsoas_left_volume_R2'],x4,'Left Iliopsoas','Mean of R1 and R2 (ml)','Volume difference (ml)')\n",
"plt.gcf().subplots_adjust(bottom=0.15)\n",
"plt.tight_layout()\n",
"plt.savefig('Bland_Altman_subplots.tiff',transparent=False) # saves the figure"
"plt.savefig('Bland_Altman_subplots.png',transparent=False) # saves the figure"
]
},
{
Expand Down
Binary file added examples/example5/Bland_Altman_subplots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/example5/Bland_Altman_subplots.tiff
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


setup(name='statsmed',
version='0.0.5',
version='0.0.6',
description='Statistics with Figures for medical data analysis',
url='https://github.com/segemart/statsmed',
author='Martin Segeroth',
Expand Down

0 comments on commit 065e2b1

Please sign in to comment.