BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi!

I'm just starting with SAS (8.2) and I was wondering how to calculate % in a table.
For example, I have 8 individuals (ident) with a number of observations for each for the variable "height". In my table, I would like to have the n, plus the % of observations corresponding to that n for each individuals, with the total of obs. at the end. Also, how could I do the same thing, but with another variable (month). For example, I want to know how many "height=8m" occurred in july, august, etc... (n and corresponding %)?

Thank you so much!
3 REPLIES 3
David_SAS
SAS Employee
Are all of the variables classification variables? Then
try:
[pre]
proc tabulate data=yourdata;
class ident height month;
table ident month, height*(n colpctn rowpctn);
run;
[/pre]
That will calculate column and row percentages. Choose whichever you like.

-- David Kelley, SAS
deleted_user
Not applicable
ok thanks! It is giving me the "general" n and %, but is there a way to get the n and % for each value (10 different) for the variable height, for ident and month? like n and % for height=8m in july for example...

thanks again!
MS
David_SAS
SAS Employee
I recommend that you contact Technical Support with your question. See http://support.sas.com/techsup/contact/submit_emits2.html .

-- David Kelley, SAS

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 664 views
  • 0 likes
  • 2 in conversation