The R Project SVN R

Rev

Rev 90207 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 90207 Rev 90259
Line 92... Line 92...
92
  The denominator \eqn{n - 1} is used which gives an unbiased estimator
92
  The denominator \eqn{n - 1} is used which gives an unbiased estimator
93
  of the (co)variance for i.i.d. observations.  These functions return
93
  of the (co)variance for i.i.d. observations.  These functions return
94
  \code{\link{NA}} when there is only one observation.
94
  \code{\link{NA}} when there is only one observation.
95
 
95
 
96
  For \code{cor()}, if \code{method} is \code{"kendall"} or
96
  For \code{cor()}, if \code{method} is \code{"kendall"} or
97
  \code{"spearman"}, Kendall's \eqn{\tau}{tau} or Spearman's
97
  \code{"spearman"}, Kendall's \eqn{\tau} or Spearman's
98
  \eqn{\rho}{rho} statistic is used to estimate a rank-based measure of
98
  \eqn{\rho} statistic is used to estimate a rank-based measure of
99
  association.  These are more robust and have been recommended if the
99
  association.  These are more robust and have been recommended if the
100
  data do not necessarily come from a bivariate normal distribution.\cr
100
  data do not necessarily come from a bivariate normal distribution.\cr
101
  For \code{cov()}, a non-Pearson method is unusual but available for
101
  For \code{cov()}, a non-Pearson method is unusual but available for
102
  the sake of completeness.  Note that \code{"spearman"} basically
102
  the sake of completeness.  Note that \code{"spearman"} basically
103
  computes \code{cor(R(x), R(y))} (or \code{cov(., .)}) where \code{R(u)
103
  computes \code{cor(R(x), R(y))} (or \code{cov(., .)}) where \code{R(u)
104
  := rank(u, na.last = "keep")}. In the case of missing values, the
104
  := rank(u, na.last = "keep")}. In the case of missing values, the
105
  ranks are calculated depending on the value of \code{use}, either
105
  ranks are calculated depending on the value of \code{use}, either
106
  based on complete observations, or based on pairwise completeness with
106
  based on complete observations, or based on pairwise completeness with
107
  reranking for each pair.
107
  reranking for each pair.
108
 
108
 
109
  When there are ties, Kendall's \eqn{\tau_b}{tau_b} is computed, as
109
  When there are ties, Kendall's \eqn{\tau_b} is computed, as
110
  proposed by \bibcitet{R:Kendall:1945}.
110
  proposed by \bibcitet{R:Kendall:1945}.
111
 
111
 
112
  Scaling a covariance matrix into a correlation one can be achieved in
112
  Scaling a covariance matrix into a correlation one can be achieved in
113
  many ways, mathematically most appealing by multiplication with a
113
  many ways, mathematically most appealing by multiplication with a
114
  diagonal matrix from left and right, or more efficiently by using
114
  diagonal matrix from left and right, or more efficiently by using