BookmarkSubscribeRSS Feed
metallon
Pyrite | Level 9

Hi SAS Experts,

I have been digging for many hours through the internet now but could not find a way to calculate the simple percentage of (N/sgu)*100.

proc tabulate data=data.data01;

class main_cat_text sub_cat_text timeframe;

var normmw nummberOf_nnnb nummberOf_b sgu rwsgalt rwsgneu;

table main_cat_text='Main Cat'*sub_cat_text='SubCat'*timeframe='timeframe',

    N='nummberOfahl' nummberOf_nnnb='nummberOfahl NN/NB'*f=4.0 nummberOf_b='nummberOfahl B'*f=4.0

    normmw=' '*(min mean median p75 p90 p95 max)

    rwsgalt='RW/SG old'*mean rwsgneu='RW/SG new'*mean sgu='nummberOfahl>RW/SG' *f=4.0;

run;

Reading through various PDF´s I tried to adjust solutions to suit my proc tabulate but....none worked. Error are many, most common:

There are multiple analysis variables associated with a single table cell in the following nesting : MAIN_CAT_TEXT *

       Main_KAT_TEXT * timeframe* All * nummberOf_nnnb * 'sgu'n * Sum.

main_cat_text All='Total',nummberOf_nnnb*sgu*(sum colpctn) ALL='Total';

main_cat_text all, (N='Gender (Count)'all)*n*f=4.(sgu='Gender (%)'all)*PCTN/box='Example of using PCTN';

(N all)*sgu*(sum*f=dollar10. rowpctsum) / rts=8;

It would be greatly appreciated if you could help to enlighted me what am I not understanding here.

Bye

1 REPLY 1
ballardw
Super User

Provide some data we can use, what you want the output to look like and reduce the example code to just the elements of interest.

Are you actually trying to divide the count of records (N) by individual values of SGU or a sum of SGU?

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1331 views
  • 0 likes
  • 2 in conversation