BookmarkSubscribeRSS Feed
finans_sas
Quartz | Level 8

Dear Community Members,

I am trying to reshape my output file (attached) such that I have the layout below. I would very much appreciate your help.

Thanks

panel1                         111       112      113      114      115      116 

model1 param                                                                   

            t

model2 param

            t

model3 param

            t

model4 param                                                                     

            t

panel2                        121       122      123      124      125      126 

model1 param                                                                 

            t

model2 param

            t

model3 param

            t

model4 param                                                                     

            t

panel3                        131       132      133      134      135      136 

model1 param                                                                 

            t

model2 param

            t

model3 param

            t

model4 param                                                                     

            t

panel4                        141       142      143      144      145      146 

model1 param                                                                 

            t

model2 param

            t

model3 param

            t

model4 param                                                                     

            t

1 REPLY 1
PGStats
Opal | Level 21

Something like this ?

proc transpose data=sasforum.A6_output out=A6_List name=model;
by panel regid _namex_;
var model:;
run;

proc sort data=A6_list; by panel model _namex_ regid;

%macro panel(p);
proc transpose data=A6_list(where=(panel=&p)) out=want&p(drop=_name_) prefix=id_;
by model _namex_;
var col1;
id regid;
idlabel regid;
run;
title "Panel = &p";
proc print data=want&p noobs label; label model="Model"; run;
%mend panel;

%panel(1);
%panel(2);
%panel(3);
%panel(4);

PG

PG

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 718 views
  • 0 likes
  • 2 in conversation