BookmarkSubscribeRSS Feed
uabcms
Calcite | Level 5
Is there a way to compute a mean from a statistic other than the 'Total' N for a particular cross-tab group.
Ex. I'm looking at DRG by year and getting a sum for Total discharges, total days, income, margin, etc.
I'd like to get income and margin by day as well as by discharge. Thanks.
4 REPLIES 4
David_SAS
SAS Employee
Could you show us your current TABULATE CLASS, VAR, and TABLE statements to give us a better idea of what you're currently doing?

-- David Kelley, SAS
uabcms
Calcite | Level 5
proc tabulate missing data=final;
where fclass in ('BC','Medicare','Medicaid','Comm');
class fyr drgn drgdesc fclass;
var pats margin los nrev netinc tcost;
table drgn='DRG'*drgdesc=' ' all='Total',fclass*fyr*(pats='D/C'*sum=' '*f=5. los='Days'*sum=' '*f=6.
los='Avg LOS'*mean=' '*F=3.1
margin='Contrib Margin'*(sum=' ' mean=' ')*f=10. nrev='Net Rev'*sum=' '*f=10.
netinc='Net Inc'*sum=' '*f=10. tcost='Total Cost'*sum=' '*f=10.);


code for Margin - in bold- gives me total margin and margin by discharge(D/C) but I'd also like to get margin by Days.
Thanks.
David_SAS
SAS Employee
If you want margin and income (only) by days (only), you'll need another TABLE statement. If it's meaningful to cross everything in your TABLE statement column dimension with days, you can simply add days to your row dimension, e.g.:

drg*drgdesc days all,

Note that it's inexpensive to code multiple TABLE statements in a single TABULATE step, because TABULATE does the input data processing only once.

-- David Kelley, SAS
uabcms
Calcite | Level 5
My goal is to get a 'By day' AND a 'By discharge' value in the same table.
So for each row, I want Discharges , days, ALOS, margin, margin per day and margin per discharge.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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