Hmisc icon indicating copy to clipboard operation
Hmisc copied to clipboard

could Hmisc/rcorr change to replace NA to 0 if there are just 1 NA in the pair?

Open BowenXiao123 opened this issue 3 years ago • 1 comments

hi,

could Hmisc/rcorr change to replace NA to 0 if there are just 1 NA in the pair and drop the pair which contains two NA?

as we know, Hmisc/rcorr function can calculate the correlation between unNaN pairs. but here is a potential problem that is I have a gene expression quantification level list and a miRNA expression quantification level list

  • NA 5.32 NA 6.45 NA 7.23
  • 3.34 NA 5.43 NA 4.15 NA

when I am trying to calculate the expression correlation between the gene and miRNA it will return NA. but seems like there are correlated.

you may say why I do not change the NA to 0. because I have to avoid another situation that

  • NA NA 5.22 NA NA NA
  • NA NA 5.43 NA NA NA

if I replace NA with 0, both 0 pairs will affect the correlation coefficient result, because there is just one actually points in the data.

thank you for your attention. Have a nice day.

BowenXiao123 avatar Oct 25 '21 13:10 BowenXiao123

and there is another situation that is if i have

  • 3.56 3.78 3.45 3.65 3.92
  • NA 2.34 NA 2.65 NA NA

the rcorr will return a high correlation between them because it dropped 1 NA pairs and just remain pairs(3.78 2.34) and (3.65 2.65). but actually, it seems like there is no correlation between them if we replace NA with 0.

BowenXiao123 avatar Oct 25 '21 13:10 BowenXiao123