set_stats {anscombiser} | R Documentation |
Create a list of summary statistics
Description
Creates a list of summary statistics to pass to mimic
.
Usage
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 |
Details
The vectors means
and variances
are recycled using
rep_len
to have length d
.
Value
A list containing the following components.
-
means
ad
-vector of sample means. -
variances
ad
-vector sample variances. -
correlation
ad
byd
correlation matrix.
Examples
# Uncorrelated with zero means and unit variances
set_stats()
# Sample correlation = 0.9
set_stats(correlation = matrix(c(1, 0.9, 0.9, 1), 2, 2))
[Package anscombiser version 1.1.0 Index]