
 
Dear all,

I've used the 'prcomp' command to
calculate the eigenvalues and eigenvectors of a  matrix(gg).

Using the command 'principal' from the
'psych' package   I've performed the same exercise. I  got the same
eigenvalues but different eigenvectors. Is there any reason for that
difference?

Below are the steps I've followed:

	1. PRCOMP

#defining the matrix
gg=matrix(byrow = TRUE, nrow = 3,data =
c(1, 0, 1, 1, 4, 2))

> gg 
[,1] [,2] 
[1,]    1    0 
[2,]    1    1 
[3,]    4    2 

pc=prcomp(gg,center=TRUE,scale=TRUE)


# The eigenvectors
pc$rotation 
PC1        PC2 
[1,] 0.7071068  0.7071068 
[2,] 0.7071068 -0.7071068 


# The eigenvalues:

> pc$sdev^2 
[1] 1.8660254 0.1339746 


2. PSYCH Package:

> pp=principal(gg,nfactors=2)

# The eigenvectors 


> pp$loadings 
Loadings: 
PC1    PC2 
[1,]  0.966 -0.259 
[2,]  0.966  0.259

# The eigenvalues

pp$values 


 
1] 1.8660254 0.1339746 



Sincerely,

Arlindo 
	[[alternative HTML version deleted]]

