BookmarkSubscribeRSS Feed
Calcite | Level 5

Hi there,


I need to create a table (se attached Excel file showing how the table should look at the en). I have data (se attached Excel fil representing the data source with the variables I need to analyse). 


I think it should work with proc tabulate, but I am not sure how to use it. I the dataset the variable "Vikt" must be use according to the Freq statement. 


I will be grateful for your help 🙂






  A lot of folks don't like to open Excel files. What code have you tried? How do you read your data? It is usually a good idea to post code in plain text format in the form of a DATA step so people can copy your program to make data or do a sample dataset using the SASHELP data, which everyone has. The code icon (little notebook with the running man icon) allows you to post code without having the Forum re-format the code.



Calcite | Level 5

Thank you Cynthia. I understand the problem with Excel. I solved my problem in different way, but I was thinking my way was not very effective and I guess the Proc tabulate could have been a smoother solution. However, I can try to follow your instructions next time.

Super User

How do we tell from your data which are people with deduction of tax for pension? In terms of the variables in your "data"

You have column heading like:

Deduction of Tax for pension savings    
0-1,2 1,2-2,4 2,4-6,0 6,0-12,0 12,0-

but there is not an obvious connection to the values of the "deduction" variable which are more in the 4500, 12000 or 17000 values. How do they map to that row of values?


You also show in your desired table:

Where by Category :

What does that mean? Or that supposed to be the category variable is also used as a row header?


Instructions here: will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.


You might want to include labels so we know which variable may represent "people".

Calcite | Level 5
Thank you for responding. The deduction 0-1,2, 1,2-2,4 and so on are intervals of the variable Deduction in the dataset that showed appear in the final table. For example 1,2 =12000 in the dataset. An observation of the variable Deduction in the dataset that equals 0 should not be included in the interval 0-1,2 in the final table. The variable Category 1=Youth, 2=Meddle age 3=Pensioners. I hope things are more clear now.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 3 in conversation