Hi all,
Please consider the following example:
Code:
clear

.  input str4 id byte str3 shock byte str3 acc byte str3 netw

            id      shock        acc       netw
  1. 1001 yes yes no
  2. 1002 yes no no
  3. 1003 yes no yes
  4. 1004 yes yes yes
  5. 1005 no yes yes
  6. 1006 no no yes
  7. end

. list

     +---------------------------+
     |   id   shock   acc   netw |
     |---------------------------|
  1. | 1001     yes   yes     no |
  2. | 1002     yes    no     no |
  3. | 1003     yes    no    yes |
  4. | 1004     yes   yes    yes |
  5. | 1005      no   yes    yes |
     |---------------------------|
  6. | 1006      no    no    yes |
     +---------------------------+
I want to find the spearman's rho coefficient between the variables "acc" and "netw", for observations having value of "shock" as "yes". I am able to find the coefficient for all 6 observations taken together, but not able to do it for the subset containing "shock"="yes".
Any help would be greatly appreciated.
Thank you.