Learn R Programming

LDLcalc (version 2.1)

ErrorCorCov: Calculate correlation and covariance of residuals

Description

This function calculates the residuals (the squared difference of each value from the mean) of two groups. Then it calculates the correlation and covariance between the residuals of the two groups and plots them.

Usage

ErrorCorCov(dataset1, dataset2, plot = F)

Value

Returns a list with the residuals of the two groups (distr1Error, distr2Error), the correlation coefficient between the two groups (Correlation) and the covariance of the two groups (Covariance).

Arguments

dataset1

A vector containing the values of the first group.

dataset2

A vector containing the values of the second group.

plot

(default=TRUE). Plot the errors of the first group versus the second one.

Examples

Run this code
if (FALSE) {
ErrorOFCorCov=ErrorCorCov(sampleA$HDL[1:20],sampleA$CHOL[1:20],plot = FALSE)
 }

Run the code above in your browser using DataLab