turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Correlations with PROC MIANALYZE

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-06-2011 11:37 PM

I am attempting to find the correlations of 8 variables from a data set of multiply imputed data. I'm fine creating the data set, however I do not understand the example for finding correlations with PROC MIANALYZE on the SAS site.

The syntax they provide is:

proc corr data=outmi out=outcorr;

var Oxygen RunTime;

by _Imputation_;

run;

proc print data=outcorr (obs=10);

title ’Correlations (First Two Imputations)’;

run;

data ztrans(type=EST);

set outcorr (drop= RunTime rename= Oxygen= Z);

if (_type_ = ’N’ or _name_ = ’RunTime’);

if (_type_ = ’CORR’) then do;

_type_= ’PARMS’;

_name_=’’;

Z= 0.5 * log((1+Z)/(1-Z));

end;

else if (_type_ = ’N’) then do;

_type_=’COVB’;

_name_=’Z’;

Z= 1. / (Z-3);

end;

run;

proc print data=ztrans;

title ’EST Type Data Set with Fisher’’s Z Transformation’;

run;

proc mianalyze data=ztrans;

ods output ParmEst=parms;

var z;

run;

set outcorr (drop= RunTime rename= Oxygen= Z);

if (_type_ = ’N’ or _name_ = ’RunTime’);

'Oxygen' and 'Runtime' are the only variables in the example data set. How would I re-write this syntax for a dataset with 8 variables? I cannot figure this out, and I can't run PROC MIANALYZE without first running this piece of syntax.

Has anyone dealt with this problem?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-06-2011 11:42 PM

Sorry--the formatting came out strange. It should have read:

I am attempting to find the correlations of 8 variables from a data set of multiply imputed data. I'm fine creating the data set, however I do not understand the example for finding correlations with PROC MIANALYZE on the SAS site.

The syntax they provide is:

proc corr data=outmi out=outcorr;

var Oxygen RunTime;

by _Imputation_;

run;

proc print data=outcorr (obs=10);

title ’Correlations (First Two Imputations)’;

run;

data ztrans(type=EST);

set outcorr (drop= RunTime rename= Oxygen= Z);

if (_type_ = ’N’ or _name_ = ’RunTime’);

if (_type_ = ’CORR’) then do;

_type_= ’PARMS’;

_name_=’’;

Z= 0.5 * log((1+Z)/(1-Z));

end;

else if (_type_ = ’N’) then do;

_type_=’COVB’;

_name_=’Z’;

Z= 1. / (Z-3);

end;

run;

proc print data=ztrans;

title ’EST Type Data Set with Fisher’’s Z Transformation’;

run;

proc mianalyze data=ztrans;

ods output ParmEst=parms;

var z;

run;

I do not understand the syntax following "data ztrans"--I understand that it is a Fisher's Z transformation, but I can't figure out how to write this for my data. Specifically, I do not understand the syntax:

set outcorr (drop= RunTime rename= Oxygen= Z);

if (_type_ = ’N’ or _name_ = ’RunTime’);

'Oxygen' and 'Runtime' are the only variables in the example data set. How would I re-write this syntax for a dataset with 8 variables? I cannot figure this out, and I can't run PROC MIANALYZE without first running this piece of syntax.

Has anyone dealt with this problem?