Description Usage Arguments Details Value Author(s) References Examples
Generate a correlation matrix from a RAM
1 | ram.2.cor(RAM)
|
RAM |
a Reticular Action model with columns "From", "To", "Arrows", and "Values" |
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.
A correlation matrix generated from a RAM model
Dustin Fife
An openmx forum about this: http://openmx.psyc.virginia.edu/thread/3866
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.