Web Images Videos Maps News Groups Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Proc Freq show values not listed?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
webonomic  
View profile  
 More options Aug 24, 1:38 pm
Newsgroups: comp.soft-sys.sas
From: webonomic <webono...@gmail.com>
Date: Mon, 24 Aug 2009 10:38:00 -0700 (PDT)
Subject: Proc Freq show values not listed?
I am doing some Proc Freqs on a variable which can have the following
possible values: 0, 1, 2, 3, 4, or 5.

Here is a test program:

data test;
input var1;
datalines;
0
0
1
1
1
3
3
3
3
3
5
;
run;

proc format;
        value var1_fmt
                0="N/A"
                1="Very Poor"
                2="Poor"
                3="Average"
                4="Good"
                5="Very Good"
                ;
run;
quit;

proc freq data=test;
        tables var1;
        format var1 var1_fmt.;
run;

-----
Resulting output:

                                var1    Frequency     Percent
                                N/A                 2       18.18
                                Very Poor           3       27.27
                                Average             5       45.45
                                Very Good           1        9.09

------
Is there a way to make the resulting proc freq output show all of the
values listed in the proc format?  I.e. I would like the output to
look something like this:

                               var1    Frequency     Percent
                                N/A                 2       18.18
                                Very Poor           3       27.27
                                Poor                  0        0
                                Average             5       45.45
                                Good                  0       0
                                Very Good           1        9.09

The only thing I can think of is to output the proc freq to a dataset,
add the "missing" values for var1, and do a proc print.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
webonomic  
View profile  
 More options Aug 24, 2:24 pm
Newsgroups: comp.soft-sys.sas
From: webonomic <webono...@gmail.com>
Date: Mon, 24 Aug 2009 11:24:48 -0700 (PDT)
Local: Mon, Aug 24 2009 2:24 pm
Subject: Re: Proc Freq show values not listed?
To clarify my question, the "missing" option is not what I am after.
Since a value of 2 and 4 do not exist in the dataset, Proc Freq simply
doesn't "know" about them.  I need to tell Proc Freq to expect values
0 through 5 and if it doesn't find a value in that range, display it
anyway.

Jared

On Aug 24, 11:38 am, webonomic <webono...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"Data _null_;"  
View profile  
 More options Aug 24, 2:31 pm
Newsgroups: comp.soft-sys.sas
From: iebup...@GMAIL.COM ("Data _null_;")
Date: Mon, 24 Aug 2009 13:31:35 -0500
Local: Mon, Aug 24 2009 2:31 pm
Subject: Re: Proc Freq show values not listed?
FREQ needs a little help in this situation.  You can get that with
PROC SUMMARY/PRELOADFMT/COMPLETETYPES or others.

proc summary nway completetypes;
   class var1 / preloadfmt;
   format var1 var1_fmt.;
   output out=work.count0(drop=_type_);
   run;
proc freq data=count0;
   tables var1;
   format var1 var1_fmt.;
   weight _freq_ / zeros;
   run;

On 8/24/09, webonomic <webono...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
webonomic  
View profile  
 More options Aug 25, 11:54 am
Newsgroups: comp.soft-sys.sas
From: webonomic <webono...@gmail.com>
Date: Tue, 25 Aug 2009 08:54:38 -0700 (PDT)
Local: Tues, Aug 25 2009 11:54 am
Subject: Re: Proc Freq show values not listed?
On Aug 24, 11:38 am, webonomic <webono...@gmail.com> wrote:

I thought I'd post a followup to this question.  I came across a SAS
knowledge base article that shows how to solve this same problem using
Proc Tabulate.
http://support.sas.com/techsup/technote/ts278.html

It also works quite well.

Jared


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google