ram.2.cor: Generate a correlation matrix from a Reticular Action Model...

Description Usage Arguments Details Value Author(s) References Examples

Description

Generate a correlation matrix from a RAM

Usage

1
  ram.2.cor(RAM)

Arguments

RAM

a Reticular Action model with columns "From", "To", "Arrows", and "Values"

Details

Although generating an implied covariance matrix from a RAM model is easy, doing so for a correlation is not as trivial since the diagonals are constrained to one. The symmetric matrix (S) must be formulated in such as way that the sum of the variances equals one. Although there may exist a closed-form solution, I know of none. So, instead, I simply used the optim function to do it. The user specifies the path coefficients in the form of a RAM matrix and the algorithm estimates what the residual correlations ought to be.

Value

A correlation matrix generated from a RAM model

Author(s)

Dustin Fife

References

An openmx forum about this: http://openmx.psyc.virginia.edu/thread/3866

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## generate a simple exercise model
RAM = data.frame(matrix(c(
	"Age", "Energy", 1, .1,
	"Age", "Self-Efficacy", 2, .1,
	"Energy", "Exercise", 1, .6,
	"Eating", "Energy", 1, .4,
	"Eating", "Self-Efficacy", 1, .3,
	"Age", "Eating", 2, .15,
	"Self-Efficacy", "Exercise", 1, .5), ncol=4, byrow=T))
names(RAM) = c("From", "To", "Arrows", "Values")
ram.2.cor(RAM)

dustinfife/DE documentation built on May 15, 2019, 6:03 p.m.