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

ahmed.a.al.attar at census.gov ahmed.a.al.attar at census.gov
Fri Aug 26 16:49:49 EDT 2011


Hi Matt,

Try using the ID Statement within Proc Means for you additional 
variable(s) along with the PRINTIDVARS option of the Proc Means.
Alternatively, try to put your additional variable(s) in the CLASS 
statement.

Hope this helps,
Ahmed



From:
matthew.e.jans at census.gov
To:
sas-users at lists.census.gov
Date:
08/26/2011 04:06 PM
Subject:
[sas-users] Using proc means to summarize at a group-level and  create new 
data file
Sent by:
sas-users-bounces at lists.census.gov




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_______________________________________________
sas-users mailing list
sas-users at lists.census.gov
http://lists.census.gov/mailman/listinfo/sas-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.census.gov/pipermail/sas-users/attachments/20110826/7be4c290/attachment-0001.html>


More information about the sas-users mailing list