Hi, I have a dataset with columns named i, j, product, v, value.
How can I calculate the correlation coefficient between v and value for each triple of i-j-product, and then plot what I get with a histogram?
I know how to get the correlation matrix for each group, but not how to use that to get the plot. This is what I tried:
Thanks!
How can I calculate the correlation coefficient between v and value for each triple of i-j-product, and then plot what I get with a histogram?
I know how to get the correlation matrix for each group, but not how to use that to get the plot. This is what I tried:
Code:
bysort i j product: pwcorr v value gen correlation = r(rho)
Comment