Learn R Programming

codep (version 1.2-4)

cdp-class: Class and Methods for Multiscale Codependence Analysis (MCA)

Description

A class and set of methods to handle the results of Multiscale Codependence Analysis.

Usage

# S3 method for cdp
print(x, ...)

# S3 method for cdp plot(x, col, col.signif = 2, main = "", ...)

# S3 method for cdp summary(object, ...)

# S3 method for cdp fitted(object, selection, components = FALSE, ...)

# S3 method for cdp residuals(object, selection, ...)

# S3 method for cdp predict(object, selection, newdata, components = FALSE, ...)

Format

cdp-class objects contain:

data

A list with two elements: the first being a copy of the response (`Y`) and the second being a copy of the explanatory variables (`X`). This is the variables that were given to MCA.

emobj

The eigenmap-class object that was given to MCA.

UpYXcb

A list with five elements: the first (`UpY`) is a matrix of the cross-products of structuring variable (`U`) and the response variable `Y`, the second (`UpX`) is a matrix of the cross-product of the structuring variable and the explanatory variables (`X`), the third (`C`) is a 3-dimensional array of the codependence coefficients, the fourth (`B`) is a 3-dimensional array of the coregression coefficients, and the fifth (`CM`) is a matrix of the multivariate codependence coefficients.

test

Results of statistical testing as performed by test.cdp or permute.cdp. NULL if no testing was performed, such as when only MCA had been called. The results of statistical testing is a list containing the following members:

$permute

The number of randomized permutations used by permute.cdp for permutation testing. 0 or FALSE for parametric testing obtained using test.cdp.

$significant

The indices of codependence coefficient describing statistically significant codependence between `Y` and `X`, in decreasing order of magnitude.

$global

The testing table (a 5-column matrix) with phi statistics, degrees-of-freedom, and testwise and familywise probabilities of type I (alpha) error. It contains one line for each statistically significant global coefficient (if any) in addition to test results for the first, non-significant coefficient, on which the testing procedure stopped.

$response

Tests of every single response variable (a 3-dimensional array), had such tests been requested while calling the testing function, NULL otherwise.

$permutations

Details about permutation testing not shown in `test$global` or `test$response`. NULL for parametric testing.

Arguments

x

A cdp-class object.

...

Further parameters to be passed to other functions or methods.

col

A vector of color values to be used for plotting the multivariate codependence coefficients.

col.signif

Color of the frame used to mark the statistically significant codependence coefficients.

main

Text for the main title of the plot.

object

A cdp-class object.

selection

A numeric vector of indices or character vector variable names to test or force-use. Mandatory if object is untested.

components

A boolean specifying whether the components of fitted or predicted values associated with single eigenfunctions in the map should be returned.

newdata

A list with elements $X, $meanY, and $target that contain the information needed to make predictions (see details).

Functions

  • print(cdp): Print method for cdp-class objects.

  • plot(cdp): Plot method for cdp-class objects.

  • summary(cdp): Summary method for cdp-class objects.

  • fitted(cdp): Fitted method for cdp-class objects.

  • residuals(cdp): Residuals method for cdp-class objects.

  • predict(cdp): Predict method for cdp-class objects.

Author

tools:::Rd_package_author("codep") Maintainer: tools:::Rd_package_maintainer("codep")

Details

The `fitted`, `residuals`, and `predict` methods return a matrix of fitted, residuals, or predicted values, respectively. The `fitted` and `predict` methods return a list a list when argument `component` is TRUE. The list contains the `fitted` or `predicted` values as a first element and an array `components` as a second. That 3-dimensional array has one matrix for each statistically significant codependence coefficient.

For making predictions, argument newdata may contain three elements: `$X`, a matrix of new values of the explanatory variables, `$meanY`, a vector of the predicted mean values of the responses, and `$target`, a matrix of target scores for arbitrary locations within the study area. When no `$X` is supplied, the descriptor given to MCA is recycled, while when no `$meanY` is supplied, the mean values of the response variables given to MCA are used.

Finally, when element `$target` is omitted from argument newdata, predictions are made at the sites were observations were done. When none of the above is provided, or if newdata is omitted when calling the prediction method, the behaviour of the `predict` method is identical to that of the `fitted` method.

From version 0.7-1, cdp-class replaces the former class mca used by codep-package because the standard package MASS also had S3 methods for a class named mca that were overwritten by those of codep-package.

References

Guénard, G., Legendre, P., Boisclair, D., and Bilodeau, M. 2010. Multiscale codependence analysis: an integrated approach to analyse relationships across scales. Ecology 91: 2952-2964

Guénard, G. Legendre, P. 2018. Bringing multivariate support to multiscale codependence analysis: Assessing the drivers of community structure across spatial scales. Meth. Ecol. Evol. 9: 292-304