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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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