BookmarkSubscribeRSS Feed
Nitte
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 🙂

 

Thanks

/MCB

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

Hi,

  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.

 

Cynthia

Nitte
Calcite | Level 5
Hi,

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.

Thanks,
Marcela
ballardw
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 :
1
2
3

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

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... 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".

Nitte
Calcite | Level 5
Hello!
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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 4 replies
  • 645 views
  • 0 likes
  • 3 in conversation