% I calculated the factorscores with the built in function.

% This result did not make a great deal of sense to me.

% The third student received marks of 10, 9 and 8.

% Why did they receive PC1 and PC2 scores that were lower than e.g, student 5 who received grades of 10,6, and 5?

factor.scores(t(gradesB),gradesB.fa.covar,Phi=NULL,method="Thurstone",rho=NULL,impute="none")

$scores

PC1 PC2

c.3..6..5. -4.1308097 -2.407048

c.7..3..3. -0.2103228 -5.367622

c.10..9..8. 2.1024528 -1.648465

c.3..9..7. -2.8073744 4.654129

c.10..6..5. 5.0460542 4.769006

$weights

PC1 PC2

[1,] 4.597787 3.595342

[2,] 8.247384 28.461893

[3,] -8.317986 -26.274719

$r.scores

PC1 PC2

PC1 1.000000 0.277824

PC2 0.277824 1.000000

$missing

c.3..6..5. c.7..3..3. c.10..9..8. c.3..9..7. c.10..6..5.

0 0 0 0 0

$R2

[1] NA NA

% I thought it would be neat to solve the linear equations myself.

% In the 2 factor model we have already calculated the factor weights.

% What I thought was why not solve the systems of equations for F1 and F2?

% Each students has 3 grades each of which express the F1 and F2 factor scores.

% So, I could there will be 3 equations in 2 variables.

% That means that I will have 3 estimates for the pairs of factor scores.

% Thus, Student 1 (Finance Mark) = b11 * F1 + b12 * F2 (1)

Student 1 ( Marketing Mark) = b21 * F1 + b22 * F2 (2)

Student 1 (Policy Mark) = b31 * F1 + b32 * F2 (3)

% The bijs have all been calculated in R.

% The only unknowns are F1 and F2 for each student.

% Yet, the F1 and F2 will be constant for each student.

% If F1 were to equal IQ, then a student would have available the same IQ for each subject.

% This is my code to solve the equations.

% I changed the -2 below to -1 and -3 in turn so that I could generate the complete

% output.

% The weights that I used were not the same as those found in the factor analysis (principal component posted above).

% The results from the pdf were duplicated when I went through a principal component factor analysis

% using the decomposition into AA' in R.

% There are a range of R functions that will do a factor analysis, I used "principal" above which might have been in error.

% I will explore fa, factnal ...

weights<- data.frame(c(3.137,0.24),c(-0.132,2.24),c(0.128,1.73))

Tweights <- t(weights)

for (i in 1:5) {

gradesC<- gradesB[-2,]

Tweights1<- Tweights[-2,]

aaa<-solve(Tweights1, gradesC[,i])

print (aaa)}

% This is the output.

% This result makes more sense to me than the official R output with the PCs.

% So, In the first set with 3rd row missing Student 1 had factor scores of 0.748 and 2.72.

In the second set with 2nd row missing Student 1 had factor scores of 0.739 and 2.84

In the third set with 1st row missing Student 1 had factor scores of 1.59 and 2.77

(not sure why in the last set Student 5 had the exact same scores).

% These scores can simply be calculated as the solutions to the linear equations for student 1.

% The Factor 2 scores for student 1 are fairly constant 2.72-2.84.

% It is the Factor 1 scores that jump around more.

York Example 3rd row missing

[1] 0.7480279 2.7226516

[1] 2.119412 1.464180

[1] 2.867440 4.186831

[1] 0.6460241 4.0559264

[1] 2.969444 2.853557

York Example 2nd row missing

[1] 0.7393969 2.8354666

[1] 2.110709 1.577936

[1] 2.850106 4.413403

[1] 0.6504469 3.9981172

[1] 2.983531 2.669427

York Example 1st row missing

[1] 1.591986 2.772385

[1] 2.970412 1.514328

[1] 4.562398 4.286713

[1] 0.2135591 4.0304419

[1] 1.591986 2.772385

The above was done for the unstandardized values,

here is the standardized grades as per the pdf.

gradestan<- data.frame(c(-1.14763,-0.26726,-0.34412),c(0.12751,-1.60356,-1.49117),c(1.08387,1.06904,

+ 1.37646),c(-1.14763,1.06904,0.80294),c(1.08387,-0.26726,-0.34412))