Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Horn's parallel analysis on polychoric correlation matrix (with factor analysis)

    Dear All,

    I am trying to perform Horn's parallel analysis on polychoric correlation matrix for principal components factor analysis. User written command paran (help file here: http://fmwww.bc.edu/RePEc/bocode/p/paran.html) seemingly allows for performing the parallel analysis not only on items (variables) but also on a matrix, which I have attemtpted to do but have run into the following error code in STATA:

    . paran, mat(R) n($N) factor(pcf)
    Ev not found
    r(111);

    end of do-file



    I have done the following;

    ***Performed polychoric correlation on my set of variables***

    polychoric $pcflist0

    *** Stored the number of obs to N***

    global N = r(sum_w)

    ****Saved the output matrix of polychoric command to R***

    matrix R = r(R)

    ***Finally, parallel analysis on this saved matrix***

    paran, mat(R) n($N) factor(pcf)

    However as I mentioned eralier, at the end I receive the following STATA error;

    . paran, mat(R) n($N) factor(pcf)
    Ev not found
    r(111);

    end of do-file



    What am I missing here?

    Kind regards,

    Rashad Jafarov
    Msc.Behavioral Economics
    Erasmus School of Economics
    Last edited by Rashad Jafarov; 19 Oct 2015, 06:17.

  • #2
    Check the position of the comma in your syntax. mat() is an option and should, thus, appear after the comma.

    Best
    Daniel

    Comment


    • #3
      Thank you Daniel!!

      I changed the position of the comma and still did not manage to get the results. I have updated the new encountered error above in the main question. Do you know , why I am receiving this error?

      Best regards,
      Rashad

      Comment


      • #4
        Nota that both, polychoric and paran are user-written commands. You seem to have paran downloaded from SSC, yet you should be explicit about that. It seems this is not the latest version of program, which seems to be

        Code:
        paran from http://www.doyenne.com/stata
            paran.  Horn's Test of Principal Components/Factors (Parallel Analysis) /
            Program by Alexis Dinno. / Support: alexis dot dinno at pdx dot edu /
            Version: 1.5.2 (updated February 25, 2014) / Distribution-Date: 25feb2014
            / / This package contains the program {cmd:paran} which performs Horn's
        The error you receive can be reproduced with the latest version (I am [still] using Stata 12.1) and it appears to be a bug in the code. The author creates various matrices (which in my view should be created as temporary names, but that is a different topic), one of which is called Ev, and this matrix is not found. Perhaps it is never created, perhaps there is just a typo in the code. I do not have the time or motivation to look through the code in more detail, and I suggest you notify the author of paran and ask her for further assistance.

        Best
        Daniel
        Last edited by daniel klein; 19 Oct 2015, 06:49.

        Comment


        • #5
          Dear Daniel,

          Thank you for your answer and time! I have done so, hopefully she will answer, and that it can be useful to other users in the future as well.

          Best regards,
          Rashad

          Comment


          • #6
            Hello all,

            I ran into the same problem. It appears that there is a fairly simple fix, though. If you open up "paran.ado", then you will find the following code starting on line 189:
            Code:
               if "`factor'" != "" {
                 if ("`mat'"=="") {
                   factor `varlist' `if' `in' [`weight' `exp'], `factor' `citerate' `protect'
                   matrix Ev = get(Ev)
                   }
                 if ("`mat'"!="") {
                   factormat `mat', n(`n')
                   factormat `mat', n(`n') `factor' `citerate' `protect'
                   }
                 }
            Notice that in the second "if" statement of the code above--beginning with "if ("`mat'"!="")"--that the line "matrix Ev=get(Ev)" isn't there like it is for the "if" statement above it. I modified the ado file by adding this line of code after line 196. The ado file should look like this when you are done (lines 189-199 shown):
            Code:
               if "`factor'" != "" {
                 if ("`mat'"=="") {
                   factor `varlist' `if' `in' [`weight' `exp'], `factor' `citerate' `protect'
                   matrix Ev = get(Ev)
                   }
                 if ("`mat'"!="") {
                   factormat `mat', n(`n')
                   factormat `mat', n(`n') `factor' `citerate' `protect'
                   matrix Ev = get(Ev)
                   }
                 }
            This fixed the issue for me. I hope it helps someone else too.

            Josh

            Comment


            • #7
              Thanks Josh, Appreciated!

              Comment

              Working...
              X