Hi everybody,
I am trying to calculate count of members according to the certain categories.
In other words I need to know how many distinct patients are under certain categories:
Medcat= “$1000”
Medcat=”$1000-2000”
Medcat=”$2000-5000”
I used proc SQL:
Proc SQL ;
Create Table Out.MedCatHmoDol As
Select MedCat , Count( Distinct Member) as NMember
From HmoDolMed
Group By MedCat ;
Quit ;
However the results of counting by categories (Medcat) makes me think that assigning of categories is wrong.
That how I assigned medcat before I used PROC SQL above:
data HMOdolmed;
set HMOdolmed;
if allow-amt<500 then medcat='<$500';
else if 500<=allow_amt<1000 then medcat='$500-$999';
else if 1000<=allow_amt<2000 then medcat='$1000-$1,999';
run;
I have a feeling that something is wrong with my splitting into categories and I wonder if the decimal of allow_amt (for ex. it looks like numeric ****.25) could cause a wrong calculation results (I mean I summary and get more than total). How can I avoid this kind error? How can I split it out not to lose anything? I have beaten my head trying to resolve it…Probably I should use Round function. How can I use it?
Any help would greately appreciated
Irin
I am trying to calculate count of members according to the certain categories.
In other words I need to know how many distinct patients are under certain categories:
Medcat= “$1000”
Medcat=”$1000-2000”
Medcat=”$2000-5000”
I used proc SQL:
Proc SQL ;
Create Table Out.MedCatHmoDol As
Select MedCat , Count( Distinct Member) as NMember
From HmoDolMed
Group By MedCat ;
Quit ;
However the results of counting by categories (Medcat) makes me think that assigning of categories is wrong.
That how I assigned medcat before I used PROC SQL above:
data HMOdolmed;
set HMOdolmed;
if allow-amt<500 then medcat='<$500';
else if 500<=allow_amt<1000 then medcat='$500-$999';
else if 1000<=allow_amt<2000 then medcat='$1000-$1,999';
run;
I have a feeling that something is wrong with my splitting into categories and I wonder if the decimal of allow_amt (for ex. it looks like numeric ****.25) could cause a wrong calculation results (I mean I summary and get more than total). How can I avoid this kind error? How can I split it out not to lose anything? I have beaten my head trying to resolve it…Probably I should use Round function. How can I use it?
Any help would greately appreciated
Irin