Creates a list of summary statistics to pass to mimic.

set_stats(d = 2, means = 0, variances = 1, correlation = diag(2))

Arguments

d

An integer that is no smaller than 2.

means

A numeric vector of sample means.

variances

A numeric vector of positive sample variances.

correlation

A numeric correlation matrix. None of the off-diagonal entries in correlation are allowed to be equal to 1 in absolute value.

Value

A list containing the following components.

  • means a d-vector of sample means.

  • variances a d-vector sample variances.

  • correlation a d by d correlation matrix.

Details

The vectors means and variances are recycled using rep_len to have length d.

Examples

# Uncorrelated with zero means and unit variances
set_stats()
#> $means
#> [1] 0 0
#> 
#> $variances
#> [1] 1 1
#> 
#> $correlation
#>      [,1] [,2]
#> [1,]    1    0
#> [2,]    0    1
#> 
# Sample correlation = 0.9
set_stats(correlation = matrix(c(1, 0.9, 0.9, 1), 2, 2))
#> $means
#> [1] 0 0
#> 
#> $variances
#> [1] 1 1
#> 
#> $correlation
#>      [,1] [,2]
#> [1,]  1.0  0.9
#> [2,]  0.9  1.0
#>