I've used a method of statistical analysis based on my own insight to determine if age correlates with a variable X over time. Each participant has a different number of records for X with different time intervals between records. Additionally, each age group has a different number participants in it as well. Now I am trying to determine if ...
... the method is valid/correct? ... the method already exists, and if so, what it is called?
The method is as follows.
I have a large sample of data measuring 2 variables: ratio X over time, and age. I divided the sample in n age groups where each group has at 100 participants in it. The range of age groups is continuous. For each participant in each age group, I calculated the line of best fit (1st degree polynomial) for variable X over time. A first degree polynomial like this line of best fit is described by its slope and intercept. For each age group, I took the mean of the slope and intercept of all the individuals in that age group to 'represent' that age group. Each age group thus has one set of slope and intercept representing that age group. Lastly, I calculated the Pearson's correlation between age and mean slopes, and between age and mean intercepts.
Assuming all assumptions for Pearson's correlation have been met, is this method valid/correct? And if so, what is it called?
PS: I have been informed there are better ways to analyze the data. Despite this, I am still curious what the answers to the above questions would be.