BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
aska_ujita
Obsidian | Level 7

Hello there!

I have measured temperament scores (0, 1, 2, 3, 4 and 5) in 40 animals (3 and 4 years old, distributed randomly) that is divided in two treatments: Treated group and control group.
I collected the temperament in day 1, 2, 3, 4 and 5 of experiment.

 

So... I would like to know if is possible to organize these scores in percentage (%) and make a table automatically by sas. I know that I can see the percentage by PROC FREQ, but it is possible to make a table with these output datas by sas?

 

thank you.

 

Aska.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

In proc freq after the tables request add / out=datasetname.

This will only work for a single table so if you are requesting multiple tables there would have to be separate tables statement for each table with a different output data set name.

Such as

proc freq data=sashelp.class;
   tables age / out=work.agefreq;
   tables sex / out=work.sexfreq;
run;

If you are doing a crosstab you may want the OUTPCT option to capture all of the percentages

proc freq data=sashelp.class;
   tables age *sex / outpct out=work.sexagefreq;
run;

The option OUTCUM will get the cumulative count and percentage for one-way tables

View solution in original post

1 REPLY 1
ballardw
Super User

In proc freq after the tables request add / out=datasetname.

This will only work for a single table so if you are requesting multiple tables there would have to be separate tables statement for each table with a different output data set name.

Such as

proc freq data=sashelp.class;
   tables age / out=work.agefreq;
   tables sex / out=work.sexfreq;
run;

If you are doing a crosstab you may want the OUTPCT option to capture all of the percentages

proc freq data=sashelp.class;
   tables age *sex / outpct out=work.sexagefreq;
run;

The option OUTCUM will get the cumulative count and percentage for one-way tables