Here is the situation. (This is not a homework problem.)
I am writing a program that does Cool And Interesting Things starting with a correlation matrix among 3 variables: call them $X$, $Y$, and $Z$. I want the user to be able to specify the correlation matrix using any combination of 3 simple or partial correlations. That is to say, the user supplies the correlation between each pair of variables, but each of those 3 correlations may be either simple or partial.
For example, one possibility would be that the user supplies the simple correlation between $Y$ and $X$, the simple correlation between $X$ and $Z$, and the partial correlation between $Y$ and $Z$ (controlling for $X$). The program should deduce the simple correlation matrix (i.e., convert the one partial correlation to a simple correlation) and then proceed from there.
The program should be able to handle any possible combination of inputs (as long as it ultimately specifies a valid simple correlation matrix.) There are basically 4 possible types of input, namely:
- 3 simple correlations
- 2 simple correlations, 1 partial correlation
- 1 simple correlation, 2 partial correlations
- 3 partial correlations
I have only the 2 of the 4 cases worked out. In the first case, obviously if the user just supplies the 3 simple correlations, then there is no problem to solve. In the last case, where the user supplies 3 partial correlations, I can obtain the simple correlation by basically reversing the procedure described HERE. But I am having a hard time working out the 2 more interesting cases. I wonder if anyone can help point me in the right direction. Thanks!
NOTE: I have cross-posted this question on the TalkStats forum, where I am an active member, HERE. Please check for answers there before duplicating another's effort.