BookmarkSubscribeRSS Feed
Yennie
Calcite | Level 5
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;
5 REPLIES 5
yonib
SAS Employee
Hi Yennie,
You cant create new vars on proc tabulate procedure,
You can do it with proc report or to manipulate the data before....
ChrisNZ
Tourmaline | Level 20
Like so?

proc tabulate data = sashelp.class;
class SEX;
var WEIGHT HEIGHT ;
table (all SEX) ,HEIGHT*sum WEIGHT*sum WEIGHT*pctsum='Ratio' ;
run;
Yennie
Calcite | Level 5
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.
ChrisNZ
Tourmaline | Level 20
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.
Peter_C
Rhodochrosite | Level 12
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

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
  • 5 replies
  • 1815 views
  • 0 likes
  • 4 in conversation