BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
opin
Calcite | Level 5

A data source have the following fields

 

@0050 V1028       15.    /* Peso COM pÛs estratificaÁ„o */
@0187 V403311      $1.    /* Faixa do valor do rendimento hab. */
@0098 V3002A      $1.    /* A escola que ... frequenta È de */

 

V1028 is imported correctly into SAS as a Type: Numeric with Length: 8.

 

However, when I run the following code:

 

proc tabulate data=pnadc_012019;
  class V403311 V3002A;
  var V1028;
  table V403311, V3002A;
run;

 

the resulting table shows the count (N), not the sum of variable V1028.

 

enter image description here

 

How do I instruct SAS to calculate the sum of this variable within proc tabulate?

1 ACCEPTED SOLUTION

Accepted Solutions
koyelghosh
Lapis Lazuli | Level 10

There is very little example data but following code is my guess. You can try it out and see it is giving what you want.

proc tabulate data=pnadc_012019;
  class V403311 V3002A;
  var V1028;
  table V403311, V3002A*V1028*SUM;
run;

View solution in original post

1 REPLY 1
koyelghosh
Lapis Lazuli | Level 10

There is very little example data but following code is my guess. You can try it out and see it is giving what you want.

proc tabulate data=pnadc_012019;
  class V403311 V3002A;
  var V1028;
  table V403311, V3002A*V1028*SUM;
run;

sas-innovate-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

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
  • 2075 views
  • 0 likes
  • 2 in conversation