Help using Base SAS procedures

PROC FREQ - Output problem

Reply
N/A
Posts: 0

PROC FREQ - Output problem

Hello everyone,

I wish to use the method PROC MEANS to obtain a table that looks like so:

Region N_obs Variable Mean Std_Dev Min Max
Africa 10 V1 1 2 3 4 5
V2 6 7 8 9 10
Asia 2 V1 11 12 13 14 15
V2 16 17 18 19 20


So I used the BY statement but i get something like this:
---------Region : Africa---------------
Variable N Mean Std_Dev Min Max
V1 1 2 3 4 5
V2 6 7 8 9 10

---------Region : Asia---------------
Variable N Mean Std_Dev Min Max
V1 11 12 13 14 15
V2 16 17 18 19 20


I have looked here http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000146729.htm but cannot seem to find what I'm looking for.

(sorry for the bad indenting. V1 and V2 and meant to be aligned in the first table)
Super Contributor
Super Contributor
Posts: 3,174

Re: PROC FREQ - Output problem

With PROC MEANS, generate an output file (use NOPRINT), and then use PROC PRINT to generate a suitable report, most likely using the ID statement I would say.

Scott Barry
SBBWorks, Inc.
Trusted Advisor
Posts: 2,113

Re: PROC FREQ - Output problem

The CLASS statement in MEANS will line it up the way you want.
Ask a Question
Discussion stats
  • 2 replies
  • 110 views
  • 0 likes
  • 3 in conversation