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-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!

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
  • 1 reply
  • 1077 views
  • 0 likes
  • 2 in conversation