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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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