Date: Wed, 15 Dec 2010 11:00:43 -0800
Reply-To: haiyan chen <haiyan_c@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: haiyan chen <haiyan_c@YAHOO.COM>
Subject: Re: Data Tabulation
In-Reply-To: <950261.20390.qm@web30204.mail.mud.yahoo.com>
Content-Type: text/plain; charset=iso-8859-1
Hi,
Proc summary will be one way to do your jobs. I would try codes below but you need to check up the exact codes by studying syntax of Proc summary:
1.proc summary;
class loan_nid dist-date;
var vl/out=output_dataset_name ave_vl=mean(vl);
run;
proc print data=output_dataset_name;
run;
2.proc summary data=output_dataset_name;
class loan_nid;
var ave_vl/out=output_dataset_name2 sum_vl=sum(ave_vl);
run;
proc print data=output_dataset_name2;
run;
Good luck!
Haiyan
--- On Wed, 12/15/10, Tanmoy Mukherjee <tkmcornell@YAHOO.COM> wrote:
From: Tanmoy Mukherjee <tkmcornell@YAHOO.COM>
Subject: Data Tabulation
To: SAS-L@LISTSERV.UGA.EDU
Date: Wednesday, December 15, 2010, 1:28 PM
Hi,
I need a small help regarding data tabulation and will appreciate if you can help me with the same.
My data is set up as follows :
Loan_nid Iteration Dist_Date v1
123411/1/201025
123412/1/201032
123421/1/201073
123422/1/201075
253611/1/201034
253612/1/201063
253621/1/201037
253622/1/201083
I want to do the following things with the data:
1. Set up the data to get Average of the variables v1 by Loan_nid and Dist_Date
Loan_nidDist_DateAvg v1
12341/1/2010avg(25,73)
12342/1/2010avg(32,75)
25361/1/2010avg(34,37)
25362/1/2010avg(63,83)
2. Then on the data generated in step 1 I want to sum up the variable v1 across Loan_nid and report it by Dist_Date
Dist_DateSum of Avg v1
1/1/2010avg(25,73) + avg(34,37)
2/1/2010avg(32,75) + avg(63,83)
I will appreciate if you can help me with this.
Thanks and Regards,
Tanmoy
Tanmoy Kumar Mukherjee
3 Perrine Court,
East Brunswick, NJ 08816
Phone: 9173994540
Email: tkmcornell@yahoo.com