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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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