BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi All,
In my Project Requirement is like this .Suppose i have datasets called d1 and d2 as follows

data d1;
input g vari;
datalines;
1 123
1 121
1 120
2 121
2 120
;
data d2;
input g vari ;
datalines;
1 121
1 122
1 123
2 122
2 125
;
I want to Findout the groupwise means

My output is like this How can i findout

1 121.5
2 122

Appriciate Great Help

Regards,

Govind.
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Proc MEANS is the procedure that springs to mind. The question however, is whether you want to find the means for D1 and D2 separately, or whether you also want to combine the two files together BEFORE you use PROC MEANS.

To simply concatenate the 2 datasets, a SET statement would be the most useful:
[pre]
data all_d;
set d1 d2;
run;

proc means data=all_d;
class g;
var vari;
run;
[/pre]

cynthia

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!

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