Announcement

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

  • Names or references for this plot after principal component analysis or factor analysis

    The advent of decent graphics within Statalist makes some questions likely to be clearer than previously. A command of mine eofplot from SSC plots loadings or coefficients after pca or factor as they vary with original variables. Here is a dopey example, but for it to work you need to install the program first.

    Code:
    ssc inst eofplot
    sysuse auto, clear
    pca headroom trunk weight length displacement
    eofplot, number xsc(r(0.8 5.2)) mlabsize(*1.4 ..) xla(, grid) yla(, ang(h))



    My questions:

    1. Is anyone familiar with this kind of plot under a different name? (I collect names of graphs more or less as I collected postage stamps around age 9.)
    My name eofplot was inspired by the terminology empirical orthogonal function but is otherwise arbitrary.

    2. Does any have example references of similar plots? I've found, for example, use of this plot very patchy in multivariate literature, even though it is often more helpful than some more widely used plots of PCA or factor analysis results. (In this example, it is clear that PC1 is essentially an average of the input variables, and thus an overall measure of vehicle size.)
    Attached Files

  • #2
    1. In the context of visualising multiple variables and their association, it is known as a parallel coordinates plot, which is often used on the raw data, but as your example shows it can be very useful for visualising the factor loadings too. In fact, it can plot any data in a matrix form I believe. So I tried using your eofplot command to make a parallel coordinates plot for the auto dataset.

    2. Here are some references I found useful: https://github.com/syntagmatic/paral...ates#resources. There is also an interactive implementation that allows a user to upload a .csv through a browser (https://syntagmatic.github.io/parall...es/upload.html). The attached photo shows a snapshot of the uploaded auto dataset, with 5 selected variables, but one could just as easily graph the factor loadings.


    An example using eofplot to graph the raw data:
    Code:
    ssc install eofplot
    
    sysuse auto, clear
    export delimited headroom trunk weight length displacement using auto.csv, replace
    
    set scheme s2color
    
    *** using eofplot to mimic a parallel coordinate plot
    capture program drop parcooplot
    program parcooplot, eclass
    syntax varlist [if]
    
    putmata X = (`varlist'), replace
    mata:st_matrix("X", X')
    matrix rownames X = `varlist'
    ereturn matrix L = X
    
    eofplot, factors(1/20) number legend(off) ytitle(values)
    end
    ***
    
    * raw data
    local varlist    headroom trunk weight length displacement
    parcooplot `varlist'
    
    local stdlist
    foreach var of local varlist {
        egen std_`var' = std(`var')
        local stdlist `stdlist' std_`var'
    }
    
    * standardized
    parcooplot `stdlist'    // output attached

    Comment


    • #3
      Thanks very much for the interest. You are right that it is one kind of parallel coordinates plot and that term is familiar to me (ssc desc parplot). I was wondering about more specific names as used after PCA or factor analysis.

      My parplot is overdue some kind of review. It was written for Stata 8 and predates Mata and some syntax or variant that allows matrix input would be a good idea. These references will come in very handy.

      Code:
      search parallel coordinates
      will show other Stata-linked stuff.

      Comment


      • #4
        Thanks for the suggested plotting modules. I really appreciate the idea of using a parplot to graph factor loadings.

        Comment


        • #5
          Hello Nick Sir... need some help on pca to form an index... the commands are somehwat like this..
          global xlist savingacc fd recurringdeposits chitty ProvidentFund microfinance others landinvest buildings construction businessenterprise share mutualfunds humancapital bonds gold otherspecify
          describe $xlist
          summarize $xlist
          corr $xlist
          pca $xlist,mineigen(1)
          screeplot, yline(1)
          pca $xlist,comp(7)blanks(.3)
          rotate, varimax
          rotate, varimax blanks(.3)
          rotate,clear
          rotate,promax
          rotate,promax blanks(.3)
          rotate,clear
          loadingplot
          scoreplot
          estat loadings
          predict assetindex
          br assetindex
          tab assetindex
          estat kmo
          ...is this correct

          Comment


          • #6
            Olive Bat Please start a new thread. Your question doesn't fit the title of this thread.

            Comment

            Working...
            X