[sas-users] Fw: frequency question

elizabeth.may.nichols at census.gov elizabeth.may.nichols at census.gov
Wed Jul 27 15:43:10 EDT 2011


This worked beautifully.  Thank you all for the help.

Beth Nichols
Center for Survey Measurement
U.S. Census Bureau
301-763-1724
elizabeth.may.nichols at census.gov



                                                                                                                       
  From:       mark.j.bousquet at census.gov                                                                               
                                                                                                                       
  To:         sas-users list for SAS Users Group <sas-users at lists.census.gov>                                          
                                                                                                                       
  Date:       07/27/2011 02:52 PM                                                                                      
                                                                                                                       
  Subject:    Re: [sas-users] Fw: frequency question                                                                   
                                                                                                                       
  Sent by:    sas-users-bounces at lists.census.gov                                                                       
                                                                                                                       





Beth,

Try this:

*Create two datasets and rename race1 to race in the first and race2 to
race in the second;
data set1(drop=race2 rename=(race1=race))
          set2(drop=race1 rename=(race2=race));
   set input;
run;

*Put the datasets back together;
data full;
   set set1 set2;
run;

*Then use proc freq on the new race variable;
proc freq;
   table race;
run;

Hope this helps!
(Embedded image moved to file: pic19877.jpg)


|------------>
| From:      |
|------------>

>----------------------------------------------------------------------------------------------------------------------------------------|

  |elizabeth.may.nichols at census.gov
|

>----------------------------------------------------------------------------------------------------------------------------------------|

|------------>
| To:        |
|------------>

>----------------------------------------------------------------------------------------------------------------------------------------|

  |sas-users at lists.census.gov
|

>----------------------------------------------------------------------------------------------------------------------------------------|

|------------>
| Date:      |
|------------>

>----------------------------------------------------------------------------------------------------------------------------------------|

  |07/27/2011 02:40 PM
|

>----------------------------------------------------------------------------------------------------------------------------------------|

|------------>
| Subject:   |
|------------>

>----------------------------------------------------------------------------------------------------------------------------------------|

  |[sas-users] Fw: frequency question
|

>----------------------------------------------------------------------------------------------------------------------------------------|

|------------>
| Sent by:   |
|------------>

>----------------------------------------------------------------------------------------------------------------------------------------|

  |sas-users-bounces at lists.census.gov
|

>----------------------------------------------------------------------------------------------------------------------------------------|







Thank you very much for getting me the right user group to ask this
question.    See below.

Beth Nichols
Center for Survey Measurement
U.S. Census Bureau
301-763-1724
elizabeth.may.nichols at census.gov

----- Forwarded by Elizabeth May Nichols/CSM/HQ/BOC on 07/27/2011 02:38 PM
-----

  From:       Elizabeth May Nichols/CSM/HQ/BOC


  To:         Katherine Drom/CSM/HQ/BOC at BOC


  Date:       07/27/2011 01:48 PM


  Subject:    frequency question






I have data that is from a mark all question.

Let's say it is race.
They stored the first answer as race1.  It could be between 1-6.  If the
person marked a second answer they stored the second answer as race 2.

race1 freq
white =5
black =4
asian =2

race 2 freq
white=1
black =1

I want a combined frequency.

race total
white=6
black=5
asian=2

I think I need to output my frequencies from the individual varialbes and
then add them together but I don't know how to do that.

I have a feeling it is a proc summary statement, but again, not sure and
have been playing round with it and haven't had luck.

Beth Nichols
Center for Survey Measurement
U.S. Census Bureau
301-763-1724
elizabeth.may.nichols at census.gov


_______________________________________________
sas-users mailing list
sas-users at lists.census.gov
http://lists.census.gov/mailman/listinfo/sas-users

[attachment "pic19877.jpg" deleted by Elizabeth May Nichols/CSM/HQ/BOC]
_______________________________________________
sas-users mailing list
sas-users at lists.census.gov
http://lists.census.gov/mailman/listinfo/sas-users





More information about the sas-users mailing list