Metadata-Version: 2.4
Name: pysa-pv
Version: 1.0.1
Summary: Library meant to analyse Large Scale Assessments in Education
Author: F Civilini
License: MIT License
        
        Copyright (c) 2025 filcivilini
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: statsmodels
Dynamic: license-file

# pysa

**pysa** provides PISA-style weighted least squares (WLS) with **BRR-Fay replicate weights** and **plausible values**.

It is designed for analyses aligned with standard OECD/PISA practices:
- full-sample student weights
- 80 BRR–Fay replicate weights
- plausible value combination using Rubin-style rules (sampling + imputation variance)

> This package is intended for research and reproducible workflows using PISA-like datasets.

---

## Features

- **Weighted least squares (WLS)** using full-sample weights
- **BRR-Fay variance estimation** using replicate weights
- **Plausible value (PV) combination**
  - Averages coefficients across PVs
  - Combines sampling + between-PV variance into final standard errors
- Flexible model specification:
  - numeric regressors (`num_vars`)
  - categorical regressors (`cat_vars`, one-hot encoded with `drop_first=True`)
  - fixed effects (`fixed_effects`, also one-hot encoded)
- Optional **country filtering**
- Clean results object: `PysaResult`

---

## Installation

### From PyPI
```bash
pip install pysa-pv
