BookmarkSubscribeRSS Feed
Csbaldne
Calcite | Level 5

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?

1 REPLY 1
Csbaldne
Calcite | Level 5

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?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1205 views
  • 0 likes
  • 1 in conversation