cor_from_upper {simdata}R Documentation

Build correlation matrix

Description

Use to specify correlation matrix in convenient way by giving entries of the upper triangular part.

Usage

cor_from_upper(n_var, entries = NULL)

Arguments

n_var

Integer, number of variables (= rows = columns of matrix).

entries

Matrix of correlation entries. Consists of 3 columns (variable_1, variable_2, correlation) that specify both variables and corresponding correlation in the upper triangular part of the matrix (i.e. variable_1 < variable_2) .

Value

Matrix with user supplied entries.

See Also

cor_to_upper

Examples

cor_from_upper(2, rbind(c(1, 2, 0.8)))


[Package simdata version 0.4.0 Index]