I have a dataset where there is list of 20 subjects, and each subject has data for 2 variables (X and Y). There are multiple entries of Xs and Ys per subject.
It is believed that there is some meaningful correlation between X and Y within each subject. Due to the heterogeneity of the population, it was requested that I run the regression by subject instead of running the regression across the entire population. As a result, I will have a different slope estimate for each subject. Each slope for each subject is deemed as a clinically useful metric. So far, the subjects in this dataset all came from the same category (say Category 1).
I will need to replicate the same “by-subject” linear regression within each subject for Category 2 and 3.
If there are 20 subjects in each of Category 1, 2 and 3, I would have in front of me 60 different slope estimates. Is there a way for me to compare the 20 slopes from each Category, and check whether these slopes are statistically significantly different based on the Category?
I was thinking of running an one-way ANOVA for the slopes. Would this be a reasonable approach? Normally, I would be more comfortable if the variable of interest is not a statistic itself, but should I really be able to run ANOVA on the 60 slope estimates? If these were something more tangible like Height or Weight, then this would be a textbook example of ANOVA. I'm just not sure whether it applies to slopes estimates.
Your help is greatly appreciated!