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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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