Learn R Programming

aclhs (version 1.0.1)

aclhs.get_correlations: Computes correlations between the original and aclhs-sampled data.

Description

Computes the Pearson, Spearman, and Kendall correlations of the independent and dependent variable of the original and aclhs-sampled data. Correlation values are rounded to the third decimal place.

Usage

aclhs.get_correlations(df, aclhs_samples)

Value

A dataframe with the original and aclhs-sampled correlation values

Arguments

df

The original data in dataframe format

aclhs_samples

The acLHS-derived sample indices

Examples

Run this code
## Get the data of interest and get the acLHS sample indices
data(ex_data_2D)
input2D <- ex_data_2D
aclhs_sam <- aclhs(df=input2D, num_samples=50, weights=c(1,1,1), iter=100)

## Compute the correlations
correlations <- aclhs.get_correlations(df=input2D, aclhs_samples=aclhs_sam)

Run the code above in your browser using DataLab