BookmarkSubscribeRSS Feed
Scottcom4
Calcite | Level 5
Hi All,

I am attempting to establish the ratio of claims to covers.

The code I have created is as follows and it results in a "." in the new variable Frequency. I have read a dozen documents on Proc Report, but just can't seem to do this simple task.

Does anyone have any ideas?

proc report data=Merged headline headskip;
column coveragecode EarnedCov Claimcount Frequency;
define coveragecode / group;
define Cov / analysis sum;
define count / analysis sum;
define Frequency / computed;

compute Frequency;
if Coveragecode = 'MC' then Frequency = sum(Claimcount/EarnedCov);
endcomp;
run;

Regards,
Scott
3 REPLIES 3
deleted_user
Not applicable
I'm not sure about that use of the sum function. Sum should be uused for summing, not division. If you have version 9.2 you will have the divide function available to you.

http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a003105093.htm

Other wise just do a division without the sum round it.
Cynthia_sas
SAS Super FREQ
Hi:
Proc Report requires that you use a specific type of variable reference for analysis variables in your COMPUTE block.
So, for example, if I wanted to divide height by age in this program:
[pre]
proc report data=sashelp.class nowd;
column name age height divided;
define name / order;
define age / sum;
define height / sum;
define divided / computed;
compute divided;
divided = height.sum / age.sum;
endcomp;
run;
[/pre]

To make this work, I have to give DIVIDED (my new report item) a usage of "COMPUTED". Then, I need a compute block for divided. Since I defined AGE and HEIGHT as analysis variables with a usage of 'SUM', then I need to ALSO use their "compound names" in the COMPUTE block for DIVIDED. Those compound names are:
varname.statistic
which means age.sum and height.sum need to be used in the compute block.

So you were -almost- there try this:
[pre]
if Coveragecode = 'MC' then Frequency = Claimcount.sum / EarnedCov.sum;
[/pre]

cynthia
Scottcom4
Calcite | Level 5
Thank you Cyntia. You are a gem.

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
  • 3 replies
  • 869 views
  • 0 likes
  • 3 in conversation