Freq table output

  • Follow


Hi,

I have two pieces of code that will create separated tables for
variable GROUP.

proc freq data=a;
  table GROUP*SUBGROUP*RESPONSE;
run;

proc means data=a;
  class GROUP SUBGROUP;
  var INCOME;
run;

How to change the first code to have the same(simlar) output as the
second one that GROUP is on the left column of the table instead of
seperated table for each Group?

Thank you!
Yvonne

0
Reply yvonnewei.yw (6) 1/10/2007 1:10:25 AM

Why not try:

proc freq
  data=a ;
  Group SubGroup ;
  table RESPONSE ;
run ;





Toby Dunn

To sensible men, every day is a day of reckoning. ~John W. Gardner

The important thing is this: To be able at any moment to sacrifice that
which we are for what we could become. ~Charles DuBois

Don't get your knickers in a knot. Nothing is solved and it just makes you
walk funny. ~Kathryn Carpenter






From: Yvonne <yvonnewei.yw@GMAIL.COM>
Reply-To: Yvonne <yvonnewei.yw@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: Freq table output
Date: Tue, 9 Jan 2007 17:10:25 -0800

Hi,

I have two pieces of code that will create separated tables for
variable GROUP.

proc freq data=a;
   table GROUP*SUBGROUP*RESPONSE;
run;

proc means data=a;
   class GROUP SUBGROUP;
   var INCOME;
run;

How to change the first code to have the same(simlar) output as the
second one that GROUP is on the left column of the table instead of
seperated table for each Group?

Thank you!
Yvonne

_________________________________________________________________
Get FREE Web site and company branded e-mail from Microsoft Office Live
http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
0
Reply tobydunn (6070) 1/10/2007 1:18:35 AM


Yvonne,

You could always concatenate group and subgroup.  For example:

data a
  set sashelp.class  (rename=(sex=group
                              age=subgroup
                              height=response
                              weight=income));;
  group_subgroup=trim(left(group))||'    '||trim(left(weight));
run;

proc freq
  data=a ;
  table group_subgroup*RESPONSE ;
run ;

Art
-----------
Yvonne wrote:
> Hi,
>
> I have two pieces of code that will create separated tables for
> variable GROUP.
>
> proc freq data=a;
>   table GROUP*SUBGROUP*RESPONSE;
> run;
>
> proc means data=a;
>   class GROUP SUBGROUP;
>   var INCOME;
> run;
>
> How to change the first code to have the same(simlar) output as the
> second one that GROUP is on the left column of the table instead of
> seperated table for each Group?
> 
> Thank you!
> Yvonne

0
Reply atabachneck (6) 1/10/2007 5:11:17 AM

On Tue, 9 Jan 2007 17:10:25 -0800, Yvonne <yvonnewei.yw@GMAIL.COM> wrote:

>Hi,
>
>I have two pieces of code that will create separated tables for
>variable GROUP.
>
>proc freq data=a;
>  table GROUP*SUBGROUP*RESPONSE;
>run;
>
>proc means data=a;
>  class GROUP SUBGROUP;
>  var INCOME;
>run;
>
>How to change the first code to have the same(simlar) output as the
>second one that GROUP is on the left column of the table instead of
>seperated table for each Group?
>
>Thank you!
>Yvonne

Use the LIST option in your TABLES statement.

Another possibility: PROC TABULATE can do all of the basic things which
MEANS and FREQ can do. It also gives you a lot of control over the
arrangement of the report.
0
Reply nospam1405 (4716) 1/10/2007 5:28:32 PM

3 Replies
48 Views

(page loaded in 0.094 seconds)

Similiar Articles:













7/14/2012 11:48:53 AM


Reply: