turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Proc Tabulate: How do I do average % ?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-11-2010 10:57 PM

Hi there,

I tabulating my results as below.

I would like to create an extra column known as

**claim_freq** and this column is basically take from the fomula of **Total SUM of claimCount / Total SUM of epy**

can someone help me out on this one please?

Proc Tabulate Data = SummaryTable;

Class FRUITS;

Var claimCount epy incurToDate earnedPrem;

Table ALL FRUITS,

SUM*claimCount, SUM*epy, MEAN*(claim_freq= SUM of claimCount / SUM of epy ) ;

Run;

I tabulating my results as below.

I would like to create an extra column known as

can someone help me out on this one please?

Proc Tabulate Data = SummaryTable;

Class FRUITS;

Var claimCount epy incurToDate earnedPrem;

Table ALL FRUITS,

SUM*claimCount, SUM*epy, MEAN*(claim_freq= SUM of claimCount / SUM of epy ) ;

Run;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-15-2010 03:23 AM

Hi Yennie,

You cant create new vars on proc tabulate procedure,

You can do it with proc report or to manipulate the data before....

You cant create new vars on proc tabulate procedure,

You can do it with proc report or to manipulate the data before....

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-18-2010 05:35 PM

Like so?

proc tabulate data = sashelp.class;

class SEX;

var WEIGHT HEIGHT ;

table (all SEX) ,HEIGHT*sum WEIGHT*sum WEIGHT*pctsum='Ratio' ;

run;

proc tabulate data = sashelp.class;

class SEX;

var WEIGHT HEIGHT ;

table (all SEX) ,HEIGHT*sum WEIGHT*sum WEIGHT*pctsum

run;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-18-2010 09:01 PM

Hi Chris,

thanks heaps on this one! Do you know what happen if it's just for average price $.

whereby say the claims cost per policy is =**total amount of money inccured to date/ number of days acrrued** ... not in percentage though.. it's dollar6.2.

cheers.

thanks heaps on this one! Do you know what happen if it's just for average price $.

whereby say the claims cost per policy is =

cheers.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-20-2010 05:34 AM

You mean the ratio (cost per policy) has to be done at observation level? and then you derive the mean of the ratios?

If so, you must compute the individual ratios before hand, proc tabulate cannot do the record-level calculation.

Having said that, the mean of the ratios seems wrong in this case.

The ratio of the sums is the number you want if I understand your data properly.

If so, you must compute the individual ratios before hand, proc tabulate cannot do the record-level calculation.

Having said that, the mean of the ratios seems wrong in this case.

The ratio of the sums is the number you want if I understand your data properly.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-07-2010 01:04 PM

ratios in Tabulate?

no problem!

(well .. almost no problem)

Just use pctsum on analysis variable for numerator and point denominator definition to the denominator of the ratio.

After that, you just need to tame the tabulate tendancy to present the result as percentage points with 10% as 10 and not .10, but proc format solves that too!

[pre]Proc format ;

picture mnyR(round) other = '00,000,001.23'( mult=1 prefix='$' ) ;

run;[/pre] * seems it needs that MULT=1 !;[pre]Proc Tabulate Data= SummaryTable ;

Class FRUITS ;

Var claimCount epy incurToDate earnedPrem ;

Table ALL FRUITS

, SUM=' '*claimCount SUM=' '*epy

claimCount=' '*pctsum='claim freq' *f= mnyR. ;

Run ; [/pre]

not quite sure why it is claimCount/epy, but hope the description above will clarify alternative ratios.

PeterC forgot to add the $

Message was edited by: Peter.C

no problem!

(well .. almost no problem)

Just use pctsum on analysis variable for numerator and point denominator definition to the denominator of the ratio.

After that, you just need to tame the tabulate tendancy to present the result as percentage points with 10% as 10 and not .10, but proc format solves that too!

[pre]Proc format ;

picture mnyR(round) other = '00,000,001.23'( mult=1 prefix='$' ) ;

run;[/pre] * seems it needs that MULT=1 !;[pre]Proc Tabulate Data= SummaryTable ;

Class FRUITS ;

Var claimCount epy incurToDate earnedPrem ;

Table ALL FRUITS

, SUM=' '*claimCount SUM=' '*epy

claimCount=' '*pctsum

Run ; [/pre]

not quite sure why it is claimCount/epy, but hope the description above will clarify alternative ratios.

PeterC forgot to add the $

Message was edited by: Peter.C