rcorr.adjust | R Documentation |
This function uses the rcorr
function in the Hmisc package
to compute matrices of Pearson or Spearman correlations along with
the pairwise p-values among the correlations. The p-values are corrected
for multiple inference using Holm's method (see p.adjust
).
Observations are filtered for missing data, and only complete observations are used.
rcorr.adjust(x, type = c("pearson", "spearman"),
use=c("complete.obs", "pairwise.complete.obs"))
## S3 method for class 'rcorr.adjust'
print(x, ...)
x |
a numeric matrix or data frame, or an object of class |
type |
|
use |
how to handle missing data: |
... |
not used. |
Returns an object of class "rcorr.adjust"
, which is normally just printed.
John Fox, adapting code from Robert A. Muenchen.
rcorr
, p.adjust
.
if (require(car)){
data(Mroz)
print(rcorr.adjust(Mroz[,c("k5", "k618", "age", "lwg", "inc")]))
print(rcorr.adjust(Mroz[,c("k5", "k618", "age", "lwg", "inc")], type="spearman"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.