RDA: Redundancy analysis

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/RDA.r

Description

Computation of weighted or unweighted redundancy analysis of a samples-by-parts compositional data table, given a set of covariates.

Usage

1
RDA(data, cov=NA, nd = NA, weight = TRUE, suprow = NA, row.wt = NA) 

Arguments

data

A data frame or matrix of interval-scale data, e.g. logratios (which are preferably in a list object with weights)

cov

List of covariates for constraining solution

nd

Number of dimensions for summary output, by default the number of constraining dimensions

weight

TRUE (default) when weights are in data list object, FALSE for unweighted analysis, or a vector of user-defined part weights

suprow

Indices of rows that are supplementary (passive) points (NOTE: this option is not implemented in this version)

row.wt

Optional user-defined set of positive weights for the rows (samples) (default: equal weights)

Details

The function RDA computes a redundancy analysis of a matrix of interval-scaled data, constrained by a matrix of covariates, using the singular value decomposition. By default weights are assumed in the data list object. For the unweighted logratio analysis, specify the option weight=FALSE. If weight = TRUE (the default) it is assumed that the weights are included in the data object, which comes from one of the logratio functions. User-specified part weights can be provided using the same weight option.

Usually row weights are not specified, they are equal unless intentional weighting of the samples is desired. Supplementary rows can be declared (also known as passive points) – these do not contribute to the solution but are positioned on the solution axes. This option will be available in the next release of the package.

Value

sv

Singular values

nd

Number of dimensions in the solution output

rownames

Row names

rowmass

Row weights

rowdist

Row distances to centroid

rowinertia

Row variances

rowcoord

Row standard coordinates

rowpcoord

Row principal coordinates

rowsup

Indices of row supplementary points

colnames

Column names

colmass

Column weights

coldist

Column logratio distances to centroid

colinertia

Column variances

colcoord

Column standard coordinates

colpcoord

Column principal coordinates

covcoord

Regression coordinates of constraining variables

covnames

Names of constraining variables

N

The data table (usually logratios in this package)

cov

The table of covariates

Author(s)

Michael Greenacre

References

Van den Wollenbergh, A. (1977), Redundancy analysis. An alternative to canonical correlation analysis, Psychometrika 42, 207-219.
Greenacre, M. (2013), Contribution biplots, Journal of Computational and Graphical Statistics 22, 107-122.

See Also

PLOT.RDA, CLR, LR, DUMMY

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Data frame fish has sex, habitat and mass in first columns, 
# then morphometric data in remaining columns
data(fish)
sex     <- fish[,1]
habitat <- fish[,2]
mass    <- fish[,3]
fishm   <- as.matrix(fish[,4:29])
# Convert to compositional data matrix
fishm   <- fishm / apply(fishm, 1, sum)
# Compute logarithm of mass and interaction of sex (F/M) and habitat (L/P) categories
logmass <- log(mass)
sexhab  <- 2*(sex-1)+habitat
sexhab.names <- c("FL","FP","ML","MP")
rownames(fishm) <- sexhab.names[sexhab]
# Create dummy variables for sexhab and create matrix of covariates
sexhab.Z <- DUMMY(sexhab, catnames=sexhab.names)
vars     <- cbind(logmass, sexhab.Z)
# Perform RDA on centred logratios
require(ca)
fish.RDA <- RDA(CLR(fishm), cov=vars)
# Plot results 
# (for more options see Appendix of Compositional Data Analysis in Practice)
PLOT.RDA(fish.RDA, map="contribution", rescale=0.05, indcat=2:5, 
         colrows=rainbow(4, start=0.1, end=0.8)[sexhab], cexs=c(0.8,0.8,1))

Example output

Loading required package: ca
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-7
Loading required package: ellipse

Attaching package:ellipseThe following object is masked frompackage:graphics:

    pairs

easyCODA documentation built on Sept. 20, 2020, 1:07 a.m.