Using PCA to combine variables in a randomized trial with a baseline and a follow-up measurement Assume that $2n$ participants have several variables measured at two times points $t_1$ (baseline) and $t_2$ (follow-up). For illustrative purposes, I will use the example of just two variables: the systolic ($SP$) and diastolic ($DP$) blood pressure. I'm not interested in combining blood pressures but in how to use a PCA to combine correlated variables in this particular design. The participants are randomized in two groups, an intervention group and a control group. The data will be analyzed using an ANCOVA which is a linear regression model of the following form: $y_{t_2, i}=\beta_0 + \beta_1y_{t_1, i} + \beta_2g_i + \epsilon_i$, where $g_i$ is a dummy variable for the group (e.g. $0 = \text{control}, 1=\text{intervention}$). The goal is to calculate the treatment effect, controlling for possible chance imbalances at $t_1$ which could lead to spurious results due to regression to the mean.
Using the example with the blood pressures, I want to take an exploratory approach and use a PCA to calculate the two coefficients in $\text{PC}_1=a_1\times DP + a_2\times SP$ (I will only use the first component). I would then use this new, combined variable in the ANCOVA described above as the outcome $y$. For simplicity, I could assume that the correlation between systolic and diastolic blood pressure is roughly the same at each time point and in each group.
I'm unclear, however, of how to apply the PCA in order to calculate the linear combination that maximizes the variance (i.e. the coefficients) because of the repeated measures design and groups. Because PCA centers the data, I'm pretty sure that just performing a PCA on all data is a bad idea because the means of the groups are different at different time points (see picture below). I could perform four different PCAs, one four each group$\times$time combination but I'm unsure if that's a proper way of doing it because this would lead to (slightly) different coefficients for each group and time point, right?
Here are some artificial data with normal data ellipses that illustrate the situation. In the simulation, I assumed that the control group does not experience any change in the variables (the blood pressures in this example) whereas the intervention group exhibits a change:


My thinking
I think a useful procedure goes like this:

*

*Center the data using the four group$\times$time specific means.

*Calculate the PCA on these centered data without scaling.

*Multiply the coefficients from this PCA with the original, uncentered data to calculate the new composite blood pressure.

*Proceed with ANCOVA using this composite measure.

Proceeding with the above toy data, we can illustrate the first step as follows:

Now we can calculate the PCA on these centered data, giving the following results:
Standard deviations (1, .., p=2):
[1] 15.733192  4.567006

Rotation (n x k) = (2 x 2):
             PC1        PC2
x1_cen 0.4953269 -0.8687067
x2_cen 0.8687067  0.4953269

So our coefficients would be $a_1 = 0.449, a_2 = 0.894$. I'm not sure though if these coefficients can be applied to the original, uncentered data. If not, this would be a problem because the centering "destroys" the changes in the groups, which is exactly what we want to find out with the ANCOVA.
Questions:

*

*Does the proposed procedure make sense or are there any problems?

*Is it ok to use the coefficients from the PCA on the original data (uncentered) to calculate the new composite variable for use in the ANCOVA?

 A: The method of collapsing SBP and DBP into one measure should be guided by subject matter expertise.  If you are interested in MAP then compute MAP.  PCA is guided by variance maximization not by subject matter meaningfulness.  If you want the data to fully speak, and don't want to impose a one-number summary, then use multivariate regression to jointly model (SBP, DBP).
A: After a bit more thinking and simulation, I couldn't find an obvious flaw with my described procedure and I wanted to explain my reasoning in this answer. If you find something wrong with it, I'd be happy to hear.
If we assume that the correlations are more or less stable across time points and groups, calculating the PCA on the group and time-specific centered data finds the general direction (i.e. the eigenvector) of maximal variance. Illustrating this with the example given in the question, here is the first component visualized as black line together with the original, uncentered and unscaled data:

The line nicely aligns with the axes of the normal ellipse, indicating the direction of maximal variance. The new variable would then be created by projection the data orthogonally onto the line:

Because the first component is calculated the same for all data, the relationship between the groups and time points is preserved.
Compare that to an example, where the PCA makes less sense in my opinion:

Here, the correlation differs between time points (it's $0.85$ at baseline and $0.55$ at follow-up). If we center these data with their group and time-specific means, we get the following graph:

The normal ellipse for the overall data is shown as continuous line whereas the time-specific ellipses are shown as dotted lines. It's obvious that there is not a single direction of maximal variance but two. Here is the same graph showing the projection using only one overall component.

To capture the variance structure for both time points, we'd need to calculate two separate PCAs on those subsets, leading to two different lines and projections as shown here:

But the use of two separate PCAs distorts the relationship between the groups and times and I'd think this makes this approach infeasible for inferring group differences in the ANCOVA.
