title: Cortest.mat converting to class "psych,sim"
body: <p>I've been using the <code>psych</code> package to compare two correlation matrices using the function <code>cortest</code>. </p>
  
  <p>Now I want to try the <code>cortest.mat</code> and <code>cortest.jennrich</code> function which require an object of the class <code>phych</code>and <code>sim</code>. I have tried converting mi correlation matrices with <code>sim.structure</code> which results in an object of such classes but I get an error when running either function.</p>
  
  <p>Here is what I've tried using Random numbers:</p>
  
  <pre><code>Random&lt;-cor(matrix(rnorm(400, 0, .25), nrow=(20), ncol=(20)))
  SimRandom&lt;-sim.structure(Random)
  class(SimRandom)
  cortest.jennrich(SimRandom,SimRandom,n1=400, n2=400)
  </code></pre>
  
  <p>Yields the following:</p>
  
  <blockquote>
    <p>Error in if (dim(R1)[1] != p) { : argument is of length zero</p>
  </blockquote>
  
  <p>I sure I'm doing it wrong 'cause of the error message and 'cause the values in Random and SimRandom are not exactly the same.</p>
  
  <p>Which is the correct way to translate a correlation matrix to a type -phych, sim- to use as input for running cortest.mat? </p>
  
  <p>Thanks in advance.</p>
  
  <p>EDIT: Short explanation on what I want to do. Using Random numbers serves just as an example. The actual correlation matrices to compare are done as follows. I have a huge list of files each composed of 100 observations for a specific genetic location. These files can be grouped into say 20 files based on known genetic relationships, thus I use those groups of files, load them into a matrix as columns and calculate cor(). That gives a correlation matrix. As a control I load random files and treat them the same way. This matrix contains real data, but the grouping is done randomly. In the end I have two correlation matrices 1-That contains the correlations of pre-selected files and 2- that contains the correlations between randomly loaded files. Both matrices are the same size. </p>
  
  <p>What I would like to do is to compare the two correlation matrices to have an idea whether the grouping has an influence on the correlation values observed. </p>
  
  <p>Sorry for not explaining this earlier, I wanted to avoid the long explanation and keep the question simple. </p>