Open DominiqueMakowski opened 4 years ago
Guess google is tired of the sjfication of R and decided to hide this result from my ~very thorough~ research :)
A package with weighted statistics is somehow missing in R, that's why I started implementing "weighted" variants of common statistical functions.
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:
cov.wt(cor = TRUE)
psych::cor.wt