[R] Psych package: Error in biplot.psych(sample.mod) : Biplot requires factor/component scores:
sjkiss at gmail.com
Wed Jun 26 00:33:48 CEST 2013
Hello: I'm trying to construct a biplot from the psych package. The underlying data frame looks just like sample.data, below. I turned it into a polychoric correlation matrix sample.cor, below, as it is derived from a series of Likert (ordinal) items. All are positive, I just used negative numbers in this dataset to get two separate factors. I created a PCA from sample.cor$rho, specifying that scores were to be kept via scores=TRUE, but the command, biplot.psych(sample.mod) returns the error message: Error in biplot.psych, Biplot requires factor/component scores.
But it seems from the help documentation, that one really only has to use the command biplot(mod) to get the plot.
Can someone please advise?
Yours, Simon Kiss
sample.data<-data.frame(var1=sample(c(0,0.33, 0.66, 1), size=100, replace=TRUE), var2=sample(c(0,0.33, 0.66, 1), size=100, replace=TRUE), var3=sample(c(0,-0.33, -0.66, -1), size=100, replace=TRUE), var4=sample(c(0,-0.33,-0.66,-1), size=100, replace=TRUE))
#Principal Components Analysis
Error in biplot.psych(sample.mod) :
Biplot requires factor/component scores:
More information about the R-help