Proc tabulate

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 89
Accepted Solution

Proc tabulate

Hi,

  I would like to know how to get the table by using proc tabulate??

Regards

KC


Capture.PNG

Accepted Solutions
Solution
‎09-01-2014 08:43 AM
Trusted Advisor
Posts: 1,228

Re: Proc tabulate

proc tabulate data=have;

var don_age rec_age ;

table don_age rec_age,mean* f=8.2 std*f=8.2;

run;

View solution in original post


All Replies
Super User
Super User
Posts: 7,720

Re: Proc tabulate

Frequent Contributor
Posts: 89

Re: Proc tabulate

Hi RW9

   Here i have two variables like don_age,rec_age .I need to find the mean,std as same as table structure i mentioned

Super User
Super User
Posts: 7,720

Re: Proc tabulate

Well, I am using SASHELP.CLASS here as no test data provided:

proc means data=sashelp.class;

  var age height;

  output out=temp mean=mean stddev=stddev;

run;

This will provide what you want (there will be a couple of extra variables which you can drop or remove in options).

Trusted Advisor
Posts: 1,228

Re: Proc tabulate

Hi,

You need to mention your analysis variable in addition to category variable. You can try something like this.

proc tabulate data=sashelp.class;

class sex;

var height;

table      

      sex=' ', height=' '* (mean * f=8.0 std * f=8.0);

run ;

Frequent Contributor
Posts: 89

Re: Proc tabulate

Hi, But my dataset doesn't contain any variables like Recipient and Donor .Purpose is to analysis age based on don_age and rec_age.

Any Possible way to get the result as same as mentioned in attached image.


Contributor
Posts: 45

Re: Proc tabulate

I guess, Class should be mentioned (for Recipient/Donar) to get the table.

Provide us the sample data so that we can try....

Solution
‎09-01-2014 08:43 AM
Trusted Advisor
Posts: 1,228

Re: Proc tabulate

proc tabulate data=have;

var don_age rec_age ;

table don_age rec_age,mean* f=8.2 std*f=8.2;

run;

Frequent Contributor
Posts: 89

Re: Proc tabulate

Thanks stat@sas.I got the desired output

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 8 replies
  • 332 views
  • 0 likes
  • 4 in conversation