CorGroups: Correlation Matrix for Sub-groups

Description Usage Arguments Details Value Author(s) References Examples

Description

The correlation matrix for sub-groups of data is computed and displayed in a graphic.

Usage

1
2
CorGroups(dat, grouping, labels1, labels2, legend, ndigits = 4,
method = "pearson", ...)

Arguments

dat

data values (probably log10-transformed)

grouping

factor with levels for different groups

labels1, labels2

labels for groups

legend

plotting legend

ndigits

number of digits to be used for plotting the numbers

method

correlation method: "pearson", "spearman" or "kendall"

...

will not be used in the function

Details

The corralation is estimated with a non robust method but it is possible to select between the method of Pearson, Spearman and Kendall. The groups must be provided by the user.

Value

Graphic with the different sub-groups.

Author(s)

Peter Filzmoser <P.Filzmoser@tuwien.ac.at> http://cstat.tuwien.ac.at/filz/

References

C. Reimann, P. Filzmoser, R.G. Garrett, and R. Dutter: Statistical Data Analysis Explained. Applied Environmental Statistics with R. John Wiley and Sons, Chichester, 2008.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(chorizon)
x=chorizon[,c("Ca","Cu","Mg","Na","P","Sr","Zn")]

#definition of the groups
lit=chorizon[,"LITO"]
litolog=rep(NA, length(lit))
litolog[lit==10] <- 1
litolog[lit==52] <- 2
litolog[lit==81 | lit==82 | lit==83] <- 3
litolog[lit==7] <- 4
litolog <- litolog[!is.na(litolog)]
litolog <- factor(litolog, labels=c("AB","PG","AR","LPS"))

par(mfrow=c(1,1),mar=c(0.1,0.1,0.1,0.1))
CorGroups(log10(x), grouping=litolog, labels1=dimnames(x)[[2]],labels2=dimnames(x)[[2]],
legend=c("Caledonian Sediments","Basalts","Alkaline Rocks","Granites"),ndigits=2)

StatDA documentation built on March 13, 2020, 2:42 a.m.

Related to CorGroups in StatDA...