Description Usage Arguments Details Value
Computes the density of correlation of the random negative control and the data correlations.
1 | compute_density(control, correlations, window_number)
|
control |
A list containing random control correlation vectors for a selected window. |
correlations |
A list containing correlations of each window against the top window. |
window_number |
An integer indicating the number of the window for which the density is to be computed. |
The density data is returned only for the selected window, therefore, compute_density
needs to be called once per window.
For both the control and the data, compute_density
converts correlations to absolute
values before computing their density.
Density is computed using the density
function, from the stats
package. However,
this function returns a density object, therefore, x and y values of density are subset
using $
.
Since there is more than one control correlation vector for a single window, given the necessity to randomize the top window several times, the mean of density y values will be returned instead. Standard error of the mean is also calculated and added and substracted from the mean to compute the maximum and minimum estimated density.
It should be noted that all control densities are assumed to provide approximately similar x values, and therefore, only those for the first control density are returned.
All these, together with x and y density values for the data correlations, are bound in a data frame and returned.
Column names of the returned data frame and their meaning:
control_x
: x values of the density object, taken from density of one
the random window's correlations.
control_y
: mean y values of density for all random correlations.
min_control_y
: control_y
minus standard error of mean.
max_control_y
: control_y
plus standard error of mean
data_y
: y values of the density object returned after computing the density
of the window correlations.
data_x
: x values of the density object returned after computing the density
of the window correlations.
A data frame containing all density data from the control and the window correlations as named columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.