Rcmdr (version 1.5-1)

rcorr.adjust: Compute Pearson or Spearman Correlations with p-Values

Description

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.

Usage

rcorr.adjust(x, type = c("pearson", "spearman"))

Arguments

x
a numeric matrix or data frame
type
"pearson" or "spearman", depending upon the type of correlations desired; the default is "pearson".

Value

  • Returns an object of class "rcorr" with an additional adj.P element.

See Also

rcorr, p.adjust.

Examples

Run this code
require(car)
rcorr.adjust(Mroz[,c("k5", "k618", "age", "lwg", "inc")])
rcorr.adjust(Mroz[,c("k5", "k618", "age", "lwg", "inc")], type="spearman")

Run the code above in your browser using DataCamp Workspace