BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sathish_jammy
Lapis Lazuli | Level 10

Hi Experts,

 

I need to report data in a histogram format. I used the below code to implement it but, it looks so wired. 

Can I get a diagram in a good representable format?

Please have a look at the attachment of (Sample dig) What I'm looking for and What I get a result in SAS.

 

When I try with gchart I got an error : 

ERROR: The PNG driver can not find any fonts. No output will be created.
ERROR: The PNG driver can not find any fonts. No output will be created.
ERROR: Physical file does not exist, C:\WINDOWS\Fonts\sasmono.ttf..

 

If there is a way kindly correct my code in sgplot itself.

Thanks in Advance!

 

 

 

data Cho_d;
Input Dur$15. Cho_mean;
cards;
Before_Surgery 156.4
6mAfter_Surgery 156.0
1yAfter_Surgery 149.5
run;
PROC SGPLOT DATA = Cho_d;
VBAR Dur / Response = Cho_mean stat=Mean;
label Dur = 'Duration';
label Cho_mean = 'Mean of Total Cholestrol Mg/dl';
TITLE 'Trends in Mean Total Cholesterol levels of 35patients after Bariatric surgery';
RUN;

img1.jpgimg2.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
data Cho_d;
Input Dur$15. Cho_mean;
cards;
Before_Surgery 156.4
6mAfter_Surgery 156.0
1yAfter_Surgery 149.5
;
run;

PROC SGPLOT DATA = Cho_d;
VBAR Dur / Response = Cho_mean datalabel;
yaxis min=80 max=240;
label Dur = 'Duration';
label Cho_mean = 'Mean of Total Cholestrol Mg/dl';
TITLE 'Trends in Mean Total Cholesterol levels of 35patients after Bariatric surgery';
RUN;

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

@Sathish_jammy wrote:

Hi Experts,

 

I need to report data in a histogram format. I used the below code to implement it but, it looks so wired. 

Can I get a diagram in a good representable format?

Please have a look at the attachment of (Sample dig) What I'm looking for and What I get a result in SAS.


More specific information is needed. What is "wired" about this diagram? What would a "good representable format" look like?

 

Also, please note that VBAR is not the same as HISTOGRAM. Is that (part of) the problem you are having?

--
Paige Miller
Ksharp
Super User
data Cho_d;
Input Dur$15. Cho_mean;
cards;
Before_Surgery 156.4
6mAfter_Surgery 156.0
1yAfter_Surgery 149.5
;
run;

PROC SGPLOT DATA = Cho_d;
VBAR Dur / Response = Cho_mean datalabel;
yaxis min=80 max=240;
label Dur = 'Duration';
label Cho_mean = 'Mean of Total Cholestrol Mg/dl';
TITLE 'Trends in Mean Total Cholesterol levels of 35patients after Bariatric surgery';
RUN;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 533 views
  • 0 likes
  • 3 in conversation