I have a sample of 2000 projects randomly extracted from a population of 10,000,000 following an exponential distribution. From this sample I would like to check if a statistical dependency exists between the number of lines of code and the number of users.
Instead of comparing these two features with Spearman's rank correlation directly on the 2000 projects, I've grouped the projects in the sample according to the number of users (obtaining 10 groups), and for each group I've calculated the average of lines of code.
The corresponding rho and p-values show that there is a significant dependency between such variables. On the contrary, if I run the Spearman's rank correlation on the 2000 projects, this dependency does not appear.
Can I say that:
- the 2000 projects are representative enough with respect to the population?
- there exists a dependency between number of users and lines of code, only if the number of lines of code for a given project is above the average?