LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2001, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 21 Feb 2001 13:24:50 -0500
Reply-To:     Eileen_Farrelly@PCIT.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Eileen Farrelly <Eileen_Farrelly@PCIT.COM>
Subject:      UPDATE re: calculating percents
Content-type: text/plain; charset=us-ascii

I am sorry for submitting such a confusing request. Let me start over.

I want to calculate the % of patients for whom I have data on out of the plan's total population ( I only have data for patients who used a particular class of drug so this would be equivalent to finding the unique number of patients in my raw dataset and dividing by the plan's total population. This would tell me that X% of the total population uses ABC drug class.

The second thing I want to calculate is the Per member Per Month (PMPM) cost for this drug class in the total plan population (not just those who use the drugs). Again this is by the formula: PMPM=((SUM_cost/12)/plan's total population)

I have successfully accomplished this since I submitted my original request using some of the advice given to me and ask if there is a better way to do this.

My raw data looks like:

patid date drug cost

1 01/01/99 A 63.50

1 02/01/99 A 63.50

1 03/01/99 B 27.46

2 02/03/99 C 45.20

2 06/05/99 D 75.20

3 08/02/99 A 57.64

3 09/01/99 A 58.64

3 10/11/99 B 35.00

I have the following code which gets me my two answers: %=6% PMPM=0.71


Data final; set rawdata; tot_pop=50; count=1; run;

/* DEPRESSION THERAPY: N AND % OF TOTAL POPULATION*/ proc sort data=final; by patid; run;

data unique; set final; by patid; if first.patid; keep patid count tot_pop; run;

proc freq data=unique; tables count/nopercent nocum; title2 'Number of unique patients in dB'; run;

PROC SUMMARY data=unique; VAR count; OUTPUT OUT=STATS SUM=db_pts; run;

data stats; merge unique stats; drop _type_ _freq_; run;

data stats2; set stats; DEP=ROUND(((db_pts/tot_pop)*100),.01); run;

proc freq data=stats2; tables DEP/nopercent nocum; title2 'Percent of patients using depression therapy in ABC Healthplan'; run;


PROC SUMMARY data=final; VAR cost; OUTPUT OUT=STATS SUM=tot_cost; run;

data stats; merge unique stats; drop _type_ _freq_; run;

data stats2; set stats; pmpm=ROUND(((tot_cost/12)/tot_pop),.01); run;

proc freq data=stats2; tables pmpm/nopercent nocum; title2 'PMPM for depression therapy for ABC Healthplan'; run;

Thanks again for all who have already responded re: using proc summary!!


Back to: Top of message | Previous page | Main SAS-L page