Combining multiply imputed correlation matrices using PROC MIANALYZE


The example titled "Combining Correlation Coefficients" in the PROC MIANALYZE documentation illustrates how to combine sample coefficients for the correlation between two variables computed from a set of imputed data sets by using Fisher's z transformation. The following extends that example by showing how to combine coefficients of the correlations among several variables forming a correlation matrix.

The following observations were taken from men involved in a physical fitness course at N.C. State University. Three variables were recorded for each participant. They were the oxygen intake (Oxygen) in ml per kg of body weight per minute, the time to run 1.5 miles (Runtime) in minutes, and the heart rate while running (RunPulse).

      data FitMiss;
        input Oxygen RunTime RunPulse @@;
        datalines;
      44.609  11.37  178     45.313  10.07  185
      54.297   8.65  156     59.571    .      .
      49.874   9.22    .     44.811  11.63  176
        .     11.95  176          .  10.85    .
      39.442  13.08  174     60.055   8.63  170
      50.541    .      .     37.388  14.03  186
      44.754  11.12  176     47.273    .      .
      51.855  10.33  166     49.156   8.95  180
      40.836  10.95  168     46.672  10.00    .
      46.774  10.25    .     50.388  10.08  168
      39.407  12.63  174     46.080  11.17  156
      45.441   9.63  164       .      8.92    .
      45.118  11.08    .     39.203  12.88  168
      45.790  10.47  186     50.545   9.93  148
      48.673   9.40  186     47.920  11.50  170
      47.467  10.50  170
      ;

The following statements run PROC MI to impute the missing values (results are not shown) and create the OUTMI data set containing the default five imputed data sets.

      proc mi data=FitMiss seed=3237851 noprint out=outmi;
        var Oxygen RunTime RunPulse;
        run;

These statements use PROC CORR to compute the correlation coefficients among the three variables and their associated Fisher's z statistics for each imputed data set. The ODS OUTPUT statement saves the Fisher's z statistics in an output data set.

      proc corr data=outmi fisher(biasadj=no);
        var Oxygen RunTime RunPulse;
        by _Imputation_;
        ods output FisherPearsonCorr=outz;
        run;

The following statements generate the standard error associated with each z statistic, StdZ = (n-3)-½. The variable, Pair, is also created which identifies the pair of variables associated with each correlation coefficient.

      data outz;
        set outz;
        StdZ= 1/sqrt(NObs-3);
        Pair=catx(' ',var,withvar);
        run;

In order to combine the correlation coefficients, ensure that the data are sorted by Pair and then by _imputation_. The PRINT step displays the data set structure.

      proc sort data=outz;
        by Pair _Imputation_;
        run;
        
      proc print data=outz noobs;
         title 'Fisher''s Correlation Statistics';
         by Pair;
         var _Imputation_ Corr ZVal;
         run;
Fisher's Correlation Statistics

 

_Imputation_CorrZVal
1-0.24825-0.25355
2-0.20061-0.20337
3-0.28792-0.29630
4-0.34238-0.35678
5-0.27108-0.27803

 

_Imputation_CorrZVal
1-0.85613-1.27869
2-0.86355-1.30715
3-0.85628-1.27922
4-0.88370-1.39243
5-0.88567-1.40146

 

_Imputation_CorrZVal
10.179360.18132
20.179890.18187
30.095490.09578
40.251780.25731
50.143890.14490

These statements use PROC MIANALYZE to generate combined Fisher's z values and their variances. The BY statement runs the procedure for each Pair of variables to get the combined Fisher's z coefficient for each correlation. The ODS OUTPUT statement saves these estimates in an output data set.

      proc mianalyze data=outz;
        by Pair;
        ods output ParameterEstimates=parms;
        modeleffects ZVal;
        stderr StdZ;
        run;

Finally, the inverse transform (TANH) is applied to the z statistics to obtain the correlation coefficients. The following statements generate and display the correlation coefficient estimates along with their p-values.

      data corr_est;
        set parms;
        r=tanh(Estimate);
        rename estimate=Fishersz;
        run;
      
      proc print data=corr_est noobs;
        var Pair r stderr Fishersz probt;
        title 'Final Combined Correlation Estimates and p-values';
        run;
Final Combined Correlation Estimates and p-values

PairrStdErrFisherszProbt
Oxygen RunPulse-0.270690.198814-0.2776050.1633
Oxygen RunTime-0.869690.200327-1.331787<.0001
RunTime RunPulse0.170550.1997910.1722370.3892