A previous post
presented the Gini coefficients for contributions to 10 Git repositories
measuring number of commits and number of lines committed.
The two were very different,
and the reason appears to be an error in how I calculated number of lines committed.
Summing (insertions - deletions) per commit doesn’t account for splitting, combining, or renaming files,
or for moving lines from one file to another.
None of the libraries I’ve looked at
will do this on their own,
so I have switched from summing lines to looking at the final state of the repository using
which identifies the author of the last change made to each line of every file.
Measuring the Gini coefficient that way tracks the Gini coefficient for number of commits per author
much more closely:
But now I have another problem.
If I count the number of commits per author in each repo,
and the number of lines in each repo credited to each author by
I can then calculate the correlation between them in two ways:
the Pearson correlation
(which uses the actual values)
and Spearman’s rank correlation
(which uses the order of the values rather than the values themselves).
For 9 of the 10 repos,
the two measures of correlation track reasonably well.
For one of them,
the Pearson correlation is moderately positive (about 0.35)
while the Spearman rank correlation is moderately negative (about -0.26).
Correlation of correlations
My question is, what does this difference between the two types of correlation tell me? For example, if the mean of a distribution is much higher than the median then I know that the distribution has a few high-valued outliers (think income distribution in the US). What general intuition should I have about a positive Pearson’s correlation coupled with a negative Spearman’s rank correlation and why?
Addendum: if it helps, here are the scatter plots of commits vs. lines (log scale on both axes) for three repositories. The first is NumPy (a large code repository); the second is the Software Carpentry lesson on the Unix shell, and the third is the lesson on Git (which has the puzzling mis-match between correlations). I can share others, but honestly, nothing jumps out in any of them.
NumPy commits vs. lines
Shell lesson commits vs. lines
Git lesson commits vs. lines