[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: Proc Corr with Multiple Files
From:       Joe Matise <snoopy369 () GMAIL ! COM>
Date:       2012-12-26 23:10:37
Message-ID: CAM+YpE-wQ4LbB_R0D=ZeLg2o72F+Q6cDjUXMuDOwCu-4efREqw () mail ! gmail ! com
[Download RAW message or body]

Don't create 200 datasets with your simulations.  Create one dataset with
200 simulations, with a hypothetical variable "SIMULATION" or whatever,
identifying which 1-200 simulation it is.  Odds are you could've created
this in one step, but it depends on what you're doing.  The paper "Don't be
LOOPy" is a good start (that creates bootstraps in a single dataset).  If
you must create the simulatinos separately, do so and then combine them
into a single dataset:
data all_reps;
set rep:;
run;
(or something like that - depending on your naming scheme, that might or
might not work).

Then do whatever you need on it.  I don't know PROC CORR well enough to
know if you can do it "all at once", or if you will need to use BY
SIMULATION; with the PROC CORR which at least is one proc statement to run
the 200 correlations, then take the resulting dataset and average that.

-Joe


On Wed, Dec 26, 2012 at 4:02 PM, Scott Colwell <scolwell@uoguelph.ca> wrote:

> I have 200 SAS data sets (Rep1 to Rep200) from a simulation. Each data set
> contains data on 16 variables with 200 observations. What I would like to
> do
> is run one PROC CORR statement using all 200 files so that I get the
> average
> correlation matrix of all 200 sets. Basically something like this:
>
>   PROC CORR DATA=Rep1-Rep200 NOSIMPLE OUTP=PEARSON;
>   VAR x1-x16;
>   RUN;
>
> Is this possible? If so, how?
>
> I could create 200 correlation matrices and then take the average but that
> seems very inefficient.
>
> Thank you.
>
> Scott
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic