[R] help with rcorr in Hmisc
John Fox
jfox at mcmaster.ca
Mon Sep 9 15:30:30 CEST 2002
Dear Ulrich,
At 10:35 AM 9/9/2002 +0200, Ulrich Leopold wrote:
>I get the following error meassage:
>
>--------------------------------------------------
>rcorr(lskPox0t30[c(22,3:7)], type=c("spearman"))
>Error in "[<-.data.frame"(*tmp*, is.na(x), value = 1e+30) :
> matrix subscripts not allowed in replacement
>--------------------------------------------------
>
>But I do not know how to solve it? Another problem could be NAs in the
>data. How can I over come this problem if I would like to omit NAs like
>use="pairwise.complete.obs"?
It looks as if you omitted a comma after the row indices;
rcorr(lskPox0t30[c(22,3:7),], type=c("spearman")) should do the trick. I
believe that rcorr will give you pairwise-present observations by default.
John
-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list