Re: proc tabulate #2

  • Follow


I simply want to know the number (N) of people
hospitalized by sex and grp.

Liyan
--- Liyan Liu <liyanliu888@yahoo.com> wrote:
> Dear fellow SAS professionals,
>
> I have a dataset with 3 variables
> hosp -- hospitalized for at least once (1,0)
> sex  -- m,f
> grp -- 1,2,3
>
> How could I use the PROC TABULATE procedure to
> produce
> a table like:
>
>
-----------------------------------------------------
>                  m              f
> total
>          --------------   -------------------
>          grp1 grp2 grp3   grp1 grp2 grp3
>
-----------------------------------------------------
> hosp
>   1
>   0
>
-----------------------------------------------------
> Inside the table is the number of people
> hospitalized.
> Thanks so much.
>
> Liyan
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product
> search
> http://shopping.yahoo.com
>


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
0
Reply liyanliu888 (12) 10/2/2003 11:39:22 PM

"Liyan Liu" wrote
> I simply want to know the number (N) of people
> hospitalized by sex and grp.

data h;input hosp sex $ grp;
_n=1; *does value 1/0 mean something in hosp?;
*if hosp = 1;
cards;
1 m 1
0 m 0
1 f 2
0 f 3
1 m 3
0 m 3
;
proc tabulate noseps formchar='            ';
class hosp sex grp;var _n;
table sex all, _n='#'*F=3. * (n=' ' pctsum<sex all>='%'*F=6.2) /rts=5
condense;
table grp all, _n='#'*F=3. * (n=' ' pctsum<grp all>='%'*F=6.2) /rts=5
condense;
table sex*grp all, _n='#'*F=3. * (n=' ' pctsum<sex*grp all>='%'*F=6.2)
/rts=5 condense;

run;


0
Reply arto.raiskio (87) 10/3/2003 12:03:58 AM


1 Replies
54 Views

(page loaded in 0.038 seconds)

Similiar Articles:













7/23/2012 2:44:15 AM


Reply: