script for partial correlation

Discussion in 'Scientific Statistics Math' started by avi, Dec 3, 2010.

  1. avi

    avi Guest

    Hello,

    Knowing the correlations between each pair of variables, is there some
    ready script (prerably in VBA or VB) for calculating the partial
    correlations of any 2 variables while controlling any number of other
    variables?

    Thanks
    Avi
     
    avi, Dec 3, 2010
    #1
    1. Advertisements

  2. avi

    Ray Koopman Guest

    If A is the inverse of the matrix of correlations or covariances among
    k variables then -A_ij/sqrt(A_ii * A_jj) is the partial correlation of
    variables i and j, controlling for the k-2 other variables. So just
    delete the rows & columns corresponding to variables that you don't
    want to be involved, and invert what's left. That's the easiest way
    to get partials, although not the most efficient computationally.
     
    Ray Koopman, Dec 3, 2010
    #2
    1. Advertisements

  3. avi

    avi Guest

    Looks promising! Thanks

    Avi
     
    avi, Dec 3, 2010
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.