Learn R Programming

qpgraph (version 2.6.1)

qpUnifRndAssociation: Uniformly random association values

Description

Builds a matrix of uniformly random association values between -1 and +1 for all pairs of variables that follow from the number of variables given as input argument.

Usage

qpUnifRndAssociation(n.var, var.names=as.character(1:n.var))

Arguments

n.var
number of variables.
var.names
names of the variables to use as row and column names in the resulting matrix.

Value

A symmetric matrix of uniformly random association values between -1 and +1.

Details

This function simply generates uniformly random association values with no independence pattern associated to them. For generating a random covariance matrix that reflects such a pattern use the function qpG2Sigma.

See Also

qpG2Sigma

Examples

Run this code
rndassociation <- qpUnifRndAssociation(100)
summary(rndassociation[upper.tri(rndassociation)])

Run the code above in your browser using DataLab