Description Usage Arguments Value Examples
This function calculates a full correlation matrix for a given dataframe. Note that all numeric variables will be converted to ordered factors.
1 2 | corrMatrix(dataframe, cop = "gauss", loss = "MH", domain = NULL,
subdomains = 1, method = "copula")
|
dataframe |
dataframe with variables. |
cop |
Only if method="copula": character string specifying which copula family to use. |
loss |
Only if method="copula": character string specifying which loss function to use. |
domain |
Only if method="copula": vector of length two specifying the allowed domain for theta. Defaults to the maximum domain. |
subdomains |
Only if method="copula": Integer specifying the number subdomains to perform numerical integration over. Used to avoid local optima. |
method |
Correlation method. Should be one of "copula", "empirical", or "spearman". |
k by k correlation matrix.
1 2 3 4 5 6 7 | #Correlation matrix for multiple variables in a dataframe
mydf <- data.frame(W=rbinom(100,1,.5), X=rbinom(100,2,.5), Y=rbinom(100,3,.5),
Z=rbinom(100,4,.5));
corrMatrix(mydf,cop="gauss",loss="MH");
corrMatrix(mydf,method="spearman");
#should be equal to:
cor(mydf,method="spearman");
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.