Metadata-Version: 2.3
Name: engstats
Version: 0.1.7
Summary: A companion package for probability and statistics for engineers
Author: Moses Y.-H. Chan
Author-email: Moses Y.-H. Chan <moses.chan@northwestern.edu>
Requires-Dist: numpy>=2.0.2
Requires-Dist: pandas>=2.2.2
Requires-Dist: scipy>=1.16.3
Requires-Dist: statsmodels>=0.14.6
Requires-Dist: matplotlib>=3.10.0
Requires-Dist: seaborn>=0.13.2
Requires-Dist: ipykernel>=6.17.1
Requires-Dist: pytest>=7.4 ; extra == 'dev'
Requires-Dist: jupyter>=1.0 ; extra == 'dev'
Requires-Python: >=3.11
Provides-Extra: dev
Description-Content-Type: text/markdown

# Companion package `engstats`

**A companion Python package for GEN_ENG 231 (IEMS 201) introductory engineering statistics class.**

The package `engstats` provides a companion package to handle making visualizations for an introductory engineering statistics class.

*A user manual is currently under construction.*

---

## Installation

```bash
pip install -U engstats
```

Or from source:

```bash
git clone https://github.com/prof-mc/engstats
cd engstats
pip install -e ".[dev]"
```

---

## Quick Start

```python
import engstats as es

# Load a bundled dataset
df = es.load_dataset("concrete")
df.head()

# Descriptive statistics
es.five_number_summary(df["strength_mpa"])
es.summary_stats(df["strength_mpa"])

# Simple linear regression
model = es.simple_linear_regression(df, x="water_cement", y="strength_mpa")
model.summary()

# Diagnostic plots
es.plot_scatter_regression(df, x="water_cement", y="strength_mpa")
es.plot_residuals(model)
es.plot_qq(model)

# Hypothesis testing
group_a = df[df["age_days"] <= 14]["strength_mpa"]
group_b = df[df["age_days"] >= 28]["strength_mpa"]
result = es.two_sample_ttest(group_a, group_b)
print(result)

# Probability
p = es.normal_prob(1.96)          # P(Z ≤ 1.96) ≈ 0.975
es.plot_normal_curve(mean=70, std=5, shade_above=80)
```

---

## Example Datasets

| Name       | Description                                         |
|------------|-----------------------------------------------------|
| `concrete` | Compressive strength vs. water-cement ratio + age   |
| `bridges`  | Load capacity vs. span length, by material          |
| `circuits` | Resistor tolerance measurements across batches      |

```python
es.load_dataset("list")   # print all available datasets
```

---

## Running Tests

```bash
pytest tests/ -v
```

---
