BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
robertrao
Quartz | Level 8

I want to create a histogram. Generally histogram gives counts/ frequency on the Y-axis and the variable on the histogram statement in Proc univariate on Y-axis. I was given a specific period(1 year) and asked to create a histogram for the length of stay(days) for the particular diagnosis code. There might be many patients with the same code in that year and have different length of stay as shown.

code  LOStay   month

500    3             feb11

500    6            mar12

501    2             apr11

501    1            aug11

501     1            sep11

501     5           jun11

thousands of data

I want to create a seperate histogram for each code.

i seperated each code into a seperate data set and did a proc univariate.

on x-axis i got LOS and on Y-axis i got percent

IS THERE A POSSIBILITY TO GET a histogram with MONTH ON X-axis and LOS days for a particular code on y-axis??????????

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

It sounds like you may want either PROC GCHART or SGPLOT.

And if you sort your data by the code, use a BY CODE statement to generate multiple plots instead of many datasets and calls to the proc.

View solution in original post

2 REPLIES 2
ballardw
Super User

It sounds like you may want either PROC GCHART or SGPLOT.

And if you sort your data by the code, use a BY CODE statement to generate multiple plots instead of many datasets and calls to the proc.

robertrao
Quartz | Level 8

Thank you so very much for the answer. very helpful.....

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1712 views
  • 0 likes
  • 2 in conversation