[sas-users] Using proc means to summarize at a group-level and create new data file

matthew.e.jans at census.gov matthew.e.jans at census.gov
Fri Aug 26 16:06:06 EDT 2011


I have a file with contact attempts nested within FR days. I'm using proc 
means to summarize characteristics of those attempts at the FR-DAY level 
(FR_DATE is a unique ID for FR and day that the contact was attempted). My 
proc means code below works, but I'd like to carry over other variables 
that I have at the FR-DAY level along with summarized values. How would I 
do that? 

I've googled and fiddled around with trying a "keep=xxxx" in different 
places, but nothing is working. 

I could recode "day_in_field" but keeping it is easier (maybe) given my 
data flow.

Thanks

*Sums up dummy vars for PV and Phone;
proc means data=work.testsumm082611 nway noprint;
class FR_DATE;
var PV Phone Int_by_PV Int_by_Phone ;
output out=fr_day_mj sum=PV Phone Int_by_PV Int_by_Phone; /*note that 
output file only includes FR_DATE _TYPE_ _FREQ_ PV and Phone*/
run;


-Matt



**********************************************************
The only stupid question is the one you don't ask.
**********************************************************

Matt Jans
Social Science Analyst
5K104B

Center for Survey Measurement
4600 Silver Hill Road
U. S. Census Bureau
Washington, DC  20233

Phone:  301.763.6724
FAX: 301.763.8399
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.census.gov/pipermail/sas-users/attachments/20110826/da5a4acb/attachment.html>


More information about the sas-users mailing list