How to create a PCA-based index from two variables when their directions are opposite? I wanted to use principal component analysis to create an index from two variables of ratio type. I am using the correlation matrix between them during the analysis. I want to use the first principal component scores as an index.
Higher values of one of these variables mean better condition while higher values of the other one mean worse condition. That is the lower values are better for the second variable. What I want is to create an index which will indicate the overall condition. Is there anything I should do before running PCA to get the first principal component scores in this situation?
 A: What you call the "direction" of your variables can be thought of as a sign, because flipping the sign of any variable will flip its "direction". The signs of individual variables that go into PCA do not have any influence on the PCA outcome because the signs of PCA components themselves are arbitrary. See here: Does the sign of scores or of loadings in PCA or FA have a meaning? May I reverse the sign?
This means that if you care about the sign of your PC scores, you need to fix it after doing PCA.
This situation arises frequently. You can e.g. fix the sign of PC1 so that it corresponds to the sign of your variable 1. This means: do PCA, check the correlation of PC1 with variable 1 and if it is negative, flip the sign of PC1.

That said, note that you are planning to do PCA on the correlation matrix of only two variables. Any correlation matrix of two variables has the same eigenvectors, see my answer here: Does a correlation matrix of two variables always have the same eigenvectors? So in fact you do not need to bother with PCA; you can center and standardize ($z$-score) both variables, flip the sign of one of them and average the standardized variables ($z$-scores). You will get exactly the same thing as PC1 from the actual PCA.
