A Python package for the life sciences to conduct hypothesis testing from CSV files.
Project description
csv-stats
Python package for rapid hypothesis testing on CSV files with data in long table format, which are common in the life sciences. Test results are saved to PDF as a rendered JSON string, or can be returned as a Python dictionary.
Installation
pip install csv-stats
Examples
All code examples below assume the following import and metadata:
from csv_stats import anova1way, anova2way, anova3way, anova_repeated
data_path = "path/to/data.csv" # Path to your CSV file
data_column = 'values' # The column to run the hypothesis tests on
group1_column = 'group1' # First grouping variable (i.e. statistical factor)
group2_column = 'group2' # Second grouping variable (i.e. statistical factor)
group3_column = 'group3' # Third grouping variable (i.e. statistical factor)
repeated_measure_column = 'subject_id' # Column indicating repeated measures (e.g. subject IDs)
ANOVA
One, two, and three-way ANOVA are supported. They include tests of homogeneity of variance and normality of residuals. Repeated measures ANOVA is also supported, including tests of sphericity.
NOTE: Currently, post-hoc tests are not implemented, but are planned for a future release.
# One way ANOVA, independent samples
result_anova1way = anova1way(data_path, group1_column, data_column)
# One way ANOVA, repeated measures
result_anova1way_rm = anova1way(data_path, group1_column, data_column, repeated_measure_column)
# Two way ANOVA, independent samples
result_anova2way = anova2way(data_path, group1_column, group2_column, data_column)
# Two way ANOVA, repeated measures
result_anova2way_rm = anova2way(data_path, group1_column, group2_column, data_column, repeated_measure_column)
# Three way ANOVA, independent samples
result_anova3way = anova3way(data_path, group1_column, group2_column, group3_column, data_column)
# Three way ANOVA, repeated measures
result_anova3way_rm = anova3way(data_path, group1_column, group2_column, group3_column, data_column, repeated_measure_column)
t-test
Both independent samples and paired samples t-tests are supported. They include tests of homogeneity of variance and normality of residuals.
from csv_stats import ttest_ind, ttest_rel
# Independent samples t-test
result_ttest_ind = ttest_ind(data_path, group1_column, data_column)
# Paired samples t-test
result_ttest_rel = ttest_dep(data_path, group1_column, data_column, repeated_measure_column)
# One sample t-test
result_ttest_1samp = ttest_1samp(data_path, group1_column, data_column) # Tests against a mean of 0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file csv_stats-0.1.1.tar.gz.
File metadata
- Download URL: csv_stats-0.1.1.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e442b38581747593e86e971d79b86102d39d6750413cbff5cb3027c29c07e6b
|
|
| MD5 |
364067116f58c75da8edfc20488b6ca2
|
|
| BLAKE2b-256 |
97d5d4455be95bb2e7b93ad668b432085e06e4fffad38d9bcbc64fb437f16427
|
File details
Details for the file csv_stats-0.1.1-py3-none-any.whl.
File metadata
- Download URL: csv_stats-0.1.1-py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed5fb49d90ea31fee906ac972f5165049d59657a321748dced32b693bb3cf706
|
|
| MD5 |
b30017e37f63a15f3aa21f40ad92112b
|
|
| BLAKE2b-256 |
16c05878df2a70bfc3b9103694295ffbb1f66e5e80bd3800c05ccf7fba965720
|