easystats / correlation

:link: Methods for Correlation Analysis
https://easystats.github.io/correlation/
Other
429 stars 55 forks source link

Uncertainty/variability propagation: weighted correlations? #28

Open DominiqueMakowski opened 4 years ago

DominiqueMakowski commented 4 years ago

I remember mentioning this somewhere, but I'll rephrase it here for future reference:

Sometimes we want to correlate x and y, where x is, for instance, the mean score of some measure for an individual (average reaction time in the condition A). This value is sometimes accompanied by some measure of variability (or uncertainty) (for instance, the SD). We might want to take this information into account in the correlation, so that observations of x that are more precise (with lower associated variability) have more weight that observations with large uncertainty.

One alternative is to use weighted correlation:

strengejacke commented 4 years ago

https://github.com/strengejacke/sjstats/blob/master/R/wtd_cor.R

DominiqueMakowski commented 4 years ago

Guess google is tired of the sjfication of R and decided to hide this result from my ~very thorough~ research :)

strengejacke commented 4 years ago

A package with weighted statistics is somehow missing in R, that's why I started implementing "weighted" variants of common statistical functions.