# Data-specific and shared variance for several dimensionalities

### Description

A function for calculating the captured variations for several
different number of retained dimensions. This is a wrapper
over `specificVar`

and `sharedVar`

to help
computing both for a range of dimensionalities.

### Usage

1 |

### Arguments

`datasets` |
A list containing the data matrices to be combined. Each matrix needs to have the same number of rows (samples), but the number of columns (features) can differ. Each row needs to correspond to the same sample in every matrix. |

`regcca` |
Output of |

`dimVector` |
A list of dimensions for which the retained variations are to be computed. |

`plot` |
A logical variable with default value FALSE. If the value is TRUE, the functions creates a plot of the output. |

### Details

The function uses `specificVar`

and `sharedVar`

to do all the computation. The purpose of this function is to provide an
easy way to visualize the properties of the reduced-dimensional
representation created by drCCA. The function also estimates the
same quantities for PCA of concatenated feature vectors to illustrate
the difference to optimal linear model based on preserving the
total variation in the whole collection of data sets.

### Value

The function returns the data-specific and shared variance for the given values of dimensions in a list. The list has four components.

`pw_cca` |
A vector with values as shared variances captured by drCCA for the given dimensions |

`pw_pca` |
A vector with values as shared variances captured by PCA for the given dimensions |

`within_cca` |
A vector with values as data-specific variances captured by drCCA for the given dimensions |

`within_pca` |
A vector with values as data-specific variances captured by PCA for the given dimensions |

### Author(s)

Abhishek Tripathi, Arto Klami

### References

Tripathi A., Klami A., Kaski S. (2007), Simple integrative preprocessing preserves what is shared in data sources, *submitted for publication*.

### See Also

`sharedVar`

,`specificVar`

### Examples

1 2 3 4 5 | ```
# data(expdata1)
# data(expdata2)
# r <- regCCA(list(expdata1,expdata2))#
# plotVar(list(expdata1,expdata2),r,c(1:2),4)
``` |