Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Averaging correlation by group, and statistics test

    Hello,

    My data is as follow:

    Click image for larger version

Name:	stata.PNG
Views:	1
Size:	5.8 KB
ID:	1697095


    I want to run the correlation by each comp, then average them. I have three questions

    1. Is the averaging appropriate here?
    2. If yes, then how can I test (in stata code or by formula if there is no stata code for this)
    3. As I know when sample size is large, most correlation test will be significantly different from 0. Is it logic to test correlation again 0.3 as a threshold rather than 0?

    Thank you
    Last edited by Truong Quoc Phan; 13 Jan 2023, 03:54.

  • #2
    To calculate the correlation by group, check out the -egen, corr()- function in the user contributed package egenmore.

    You can average whatever you want. To know whether it is appropriate you need to know for what purpose you are averaging.

    Comment


    • #3
      I am usually wary of averaging correlations if only because the correlation for a combination of groups can be far from the average of correlations for each group. You can even construct or find situations where the average correlation has a different sign. Cue mentions of Simpson's paradox, and so forth.

      But if you must average one line of thought runs that you should go tanh(mean(atanh(r)), that is, average on the scale of the so-called Fisher z transformation and then back-transform. There is a little more on this in Section 5 of https://www.stata-journal.com/articl...article=pr0041

      Comment

      Working...
      X