pg-correlationslisted
Install: claude install-skill Exekiel179/pingouin-psych-stats
# PG Correlations
Use for association analyses between continuous or ordinal variables.
## Load
Read:
- `../../references/supervision-gates.md`
- `../../references/pingouin-api-quickref.md`
- `../../references/apa-output-template.md` if writing results.
## Function Choice
- Two continuous variables, linear association -> `pg.corr(..., method="pearson")`.
- Ordinal or monotonic/non-normal association -> `method="spearman"` or `method="kendall"`.
- Association controlling covariates -> `pg.partial_corr`.
- Many variables -> `pg.pairwise_corr` with `padjust`.
- Repeated observations per participant -> `pg.rm_corr`.
- Nonlinear dependence screening -> `pg.distance_corr` if appropriate.
## Required Inputs
- Variables to correlate.
- Whether observations are independent.
- Covariates, if partial correlation is requested.
- Multiple-comparison family and correction.
- Hypothesis direction; default to two-sided.
## Code Patterns
Basic correlation:
```python
res = pg.corr(x=df["x"], y=df["y"], method="pearson",
alternative="two-sided").round(3)
pg.print_table(res)
```
Partial correlation:
```python
res = pg.partial_corr(data=df, x="x", y="y",
covar=["age", "baseline"],
method="pearson").round(3)
```
Pairwise correlations:
```python
res = pg.pairwise_corr(data=df, columns=["x", "y", "z"],
method="spearman", padjust="holm").round(3)
```
Repeated-measures correlation:
```python
res = pg.rm_c