R Biplot Psych

Added a biplot.psych function to do biplots of fa or principal results. Added an unbiased estimate of kurtosis in the kurtosi function. Added a predict function to fa and principal (predict.fa and predict.principal, both called from predict.psych) Added lavaan.diagram to draw the output from a cfa or sem from the lavaan package. Scale # covariance biplot (scale = 1), form biplot (scale = 0). When scale = 1, the inner product between the variables approximates the covariance and the distance between the points approximates the Mahalanobis distance. Obs.scale # 标准化观测值 var.scale # 标准化变异 pc.biplot # 兼容 biplot.princomp groups # 组信息. Rotations and transformations are either part of psych (Promax and cluster), of base R (varimax), or of GPArotation (simplimax, quartimax, oblimin). Some of the statistics reported are more appropriate for (maximum likelihood) factor analysis rather than principal components analysis, and are reported to allow comparisons with these other models. R/biplot.psych.R In psych: Procedures for Psychological, Psychometric, and Personality Research Defines functions plotone. #rewritten Sept 18,2013 to.

Working on a recent project to characterize the underlying factors of urban typology, we needed a quick means of visualizing the factor loadings of each indicator. We had used the “pysch” library’s “fa” function to get the analysis done. However, a quick visualization approach was not forthcoming. One of my research assistants found this fantastic example using ‘ggplot2’. However, getting the ggplot function call to work was not quite as straightforward as in the example shown.

In case you are in a similar situation, where you have obtained the loading matrix directly from the ‘fa’ function and want to use the beautiful rendering of the ggplot facet-bar approach, below is code that you might find useful.

The additional steps involve converting the loading matrix to a dataframe and then converting the row names to a dataframe column. Ignore the descriptive factor names chosen for this example, and the input file can be dataframe or matrix.