Metadata-Version: 2.3
Name: ltc-ein-college-type
Version: 0.1.0
Summary: EIN-by-tax-year college type crosswalk, with the scripts that build and apply it
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# ltc-ein-college-type

A crosswalk from a college's EIN and tax year to its type (four-year, or
two-year or less), with the two scripts that build and apply it. The scripts
are the same as the ones in `ltc-code` under `nsc/`.

Everything installs into the `ltc_ein_college_type` folder:

| File | What it is |
| --- | --- |
| `ein_college_type.csv` | The crosswalk: one row per EIN and tax year, 2011-2022 |
| `assign_ein_college_type.py` | Joins the crosswalk to student-level 1098-T data and defines four-year and two-year attendance by each age |
| `build_ein_college_type.py` | Builds the crosswalk from the files in `raw/` |
| `raw/directory.dta`, `raw/IPEDS_IC_2013.csv`, `raw/ipeds_hd/hd2018.csv` to `hd2022.csv` | Public IPEDS directory files the build reads |

The package declares no dependencies. The scripts need `polars`, and the
build script also needs `polars-readstat`.

## Crosswalk columns

| Column | Meaning |
| --- | --- |
| `ein` | EIN as an integer |
| `year` | Tax year; for a student this is birth cohort plus age |
| `college_type` | `4yr` or `2yr` (two-year or less) |
| `mixed` | True if the EIN covered both sectors that year and was set to four-year |
| `ipeds_year` | The IPEDS year the type came from; differs from `year` when IPEDS did not list the EIN that year |

## Using it

Find the installed folder with:

```
python -c "import ltc_ein_college_type, pathlib; print(pathlib.Path(ltc_ein_college_type.__file__).parent)"
```

`assign_ein_college_type.py` expects a student-level file with `cohort`
(birth cohort), `any1098T{age}` and `ein{age}` for ages 18-26. Set the two
placeholder paths at the top of the script, then run it. To rebuild the
crosswalk, run `python -m ltc_ein_college_type.build_ein_college_type`.

Never put student records in this package. The build excludes the `input`
and `output` folders.
