[sas-users] Fw: frequency question

mark.j.bousquet at census.gov mark.j.bousquet at census.gov
Wed Jul 27 14:52:48 EDT 2011


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic19877.jpg
Type: image/jpeg
Size: 12235 bytes
Desc: not available
URL: <http://lists.census.gov/mailman/private/sas-users/attachments/20110727/d728f676/attachment-0001.jpg>


More information about the sas-users mailing list