# Principal component analysis (PCA) with repeated measurements: how to perform a multiple factor analysis in R?

Given Data:
I have set up a short questionnaire consisting of 7 items (X = 7)(i.e. response variables). About 40 participants were part of my study (N=40) and each participant answered to all the 7 questions in 5 ocassions (Y=5) (i.e. repeated measurements). In total this leads to Y times, N participants and X items. The main goal is to find underlying components. Note: I know that 7 items is not much, but ignore this fact for now please.

What I have Done
I performed a PCA by row binding the repeated measurements that yielded a total number of rows = 5 (X) x 40 (N) = 200. This worked fine and led to total acceptable components. This "approach uses all the data; however, by ignoring the dependencies in the data, the standard errors for parameter estimates and the model fit statistics may be misleading" as Steven et al. (2005) warmed in the context of analysing data sets with repeated measurements. The authors pointed out the need to account for the two sources of variance in such data set structure, that is the within-participant variation (over time) and the between-participant variation.

To overcome the issue of ignoring repeated measures I want to perform a Multiple Factor Analysis . As described in this post, I therefore followed the instructions and column-binded the repeated measurements (in groups of 7 variables per each Y) and built a DataFrame with this structure:

                 Measure 1 (X columns)| Measure 2 (X columns) | ... | Measure 5 (X columns)
Participant 1
...
Participant 40


The dataframe contained 40 rows (participants) and 35 columns (variables as 5 (Y)* 7 (X).

MFA was performed using this line of code (Package: FactoMineR):

mfa1 = MFA(df, group=c(7, 7, 7, 7, 7),
name.group= c("T1", "T2", "T3", "T4", "T5"),
ncp=7)


Note: the data type argument is missing in the code and all 7 variables need to be of the same type. For example, for categorical variables it would be: 'type= c('n','n','n', 'n', 'n')'.

The code runs well and it does not give errors. Thus, I can easily browse through the results.

The Problem
How to proceed with the mfa1 object to get the eigenvalues of components made of the items X. The eigenvalues shown by mfa1$eig give me 39 components, guessing this is made up of the participants. Another Note: By calling mfa1$separate.analyses$T1 ... mfa1$separate.analyses\$T5 I get exactly the information I need, but not "together", but rather split to single PCAs.

What I need
I hope I would have the chance to get the "overall" eigenvalues and/or a correlation matrix for the items/components made of the items X, taking into account within-individuals differences as well as between-individual differences. Something that combines the 5 single "separate.analyses.TY". I really need help to find a solution with this problem in R. Thanks in advance.

Refs
Steven P. Reise , Joseph Ventura , Keith H. Nuechterlein & Kevin H. Kim (2005) An Illustration of Multilevel Factor Analysis, Journal of Personality Assessment, 84:2, 126-136, DOI: 10.1207/s15327752jpa8402_02