From: CC on
Hi dear all,

just wondering that can I output the correlation matrix to a dataset
from the PROC REG procedure. The code I am using is:
proc reg data = afreg outest=relation corr;
model hret12 = ICC / ADJRSQ;
by calyear;
quit;

I can see the correlation matrix from the output but is there way to
output this table to a dataset? Thanks in advance!
From: Reeza on
On Jul 27, 5:04 pm, CC <chchanghe...(a)gmail.com> wrote:
> Hi dear all,
>
> just wondering that can I output the correlation matrix to a dataset
> from the PROC REG procedure.  The code I am using is:
> proc reg data = afreg  outest=relation corr;
>         model hret12 = ICC /  ADJRSQ;
>         by calyear;
>         quit;
>
> I can see the correlation matrix from the output but is there way to
> output this table to a dataset?  Thanks in advance!

Probably in more than one way...

One possibility is the ods table features. Usually something like ODS
Table Corr=table_name;

Another is using the Proc Corr with the variables above.
From: Reeza on
On Jul 27, 5:04 pm, CC <chchanghe...(a)gmail.com> wrote:
> Hi dear all,
>
> just wondering that can I output the correlation matrix to a dataset
> from the PROC REG procedure.  The code I am using is:
> proc reg data = afreg  outest=relation corr;
>         model hret12 = ICC /  ADJRSQ;
>         by calyear;
>         quit;
>
> I can see the correlation matrix from the output but is there way to
> output this table to a dataset?  Thanks in advance!

Sorry, shoud be ods output actually. The following will create a
dataset 'corrtable' with the correlation matrix.

ods output Corr=corrtable;
proc reg data=sashelp.cars corr;
model horsepower=cylinders;
run;quit;

From: CC on
On Jul 28, 10:12 am, Reeza <fkhurs...(a)hotmail.com> wrote:
> On Jul 27, 5:04 pm, CC <chchanghe...(a)gmail.com> wrote:
>
> > Hi dear all,
>
> > just wondering that can I output the correlation matrix to a dataset
> > from the PROC REG procedure.  The code I am using is:
> > proc reg data = afreg  outest=relation corr;
> >         model hret12 = ICC /  ADJRSQ;
> >         by calyear;
> >         quit;
>
> > I can see the correlation matrix from the output but is there way to
> > output this table to a dataset?  Thanks in advance!
>
> Sorry, shoud be ods output actually. The following will create a
> dataset 'corrtable' with the correlation matrix.
>
> ods output Corr=corrtable;
> proc reg data=sashelp.cars corr;
> model horsepower=cylinders;
> run;quit;

Hi Reeza,

Thanks a lot. I tried the ods function as you suggested before seeing
your second message. I wrote similar codes as you provided and got
the data. Thanks!