|
Toby, thank you for your method. It looks it works and categorises my Medcat.
However the results of counting by categories (Medcat) makes me think that assigning of categories is wrong
That how I assigned medca before I used the code you provided me with:
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 wonder if the decimal of allow_amt (for ex. it looks like numeric 500.25) could cause a wrong calculation results (I mean I summarise and get more than total). How can I avoid this error ?
Thank you in advance!
Irin
toby dunn <tobydunn@HOTMAIL.COM> wrote:
Irin ,
Proc Means and SUmmary require variables of the Numeric persuasion. To get
what you want try SQL:
Proc SQL ;
Create Table Out.MedCatHmoDol As
Select MedCat , Count( Distinct Member) as NMember
From HmoDolMed
Group By MedCat ;
Quit ;
Toby Dunn
From: Irin later
Reply-To: Irin later
To: SAS-L@LISTSERV.UGA.EDU
Subject: how to calculate a count of members by categories while member id
is a string?
Date: Tue, 27 Jun 2006 12:20:04 -0700
I am trying to calculate count of members according to the certain
categories.
In other words I need to know how many distinct patients (whose IDs are
of char data type) are under certain categories:
Medcat= “$1000”
Medcat=”$1000-2000”
Medcat=”$2000-5000”
I used proc summary below:
Proc summary
data = HMOdolMed;
class Medcat ;
var member;
output out = out.MedcatHMOdol N(member) = NMember;
run ;
The error log told me the following:
Proc summary
54 data = HMOdolMed;
55 class Medcat ;
56 var member;
ERROR: Variable MEMBER in list does not match type prescribed for this
list.
ERROR: Variable MEMBER in list does not match type prescribed for this
list.
ERROR: Variable MEMBER in list does not match type prescribed for this
list.
*************************************************************************
Does it mean that var member (which is ID. Data type is character)should
be numeric?
If so…how can I resolve this problem (calc counts by categories)?
Thank you in advance,
Irin
---------------------------------
Yahoo! Groups gets better. Check out the new email design. Plus there’s much
more to come.
---------------------------------
Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.
|