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

My goal is to make this:

cc.png

I used this code, but I'm getting more outputs then I originally planned although I do get the graph:

proc univariate data=sashelp.bweight;
var weight;
class boy;
histogram weight / NORMAL;

 

An example of extra outputs that I get is this for boy=0 and boy=1. I just want the histogram not these extra outputs:

The SAS System

The UNIVARIATE Procedure
Boy = 1
Fitted Normal Distribution for Weight (Infant Birth Weight)
Parameters for Normal DistributionParameter Symbol EstimateMeanStd Dev
Mu3427.252
Sigma577.6727

 

Goodness-of-Fit Tests for Normal DistributionTest Statistic p ValueKolmogorov-Smirnov DPr > DCramer-von Mises W-SqPr > W-SqAnderson-Darling A-SqPr > A-Sq
0.052368<0.010
19.182203<0.005
129.781086<0.005

 

Quantiles for Normal DistributionPercent QuantileObserved Estimated1.05.010.025.050.075.090.095.099.0
1559.002083.38
2495.002477.07
2778.002686.93
3119.003037.62
3459.003427.25
3799.003816.89
4082.004167.57
4281.004377.44
4678.004771.12
1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Simply add an ODS select statement :

 

proc univariate data=sashelp.bweight;
var weight;
class boy;
histogram weight / NORMAL;
ods select Histogram;
run;

To get the list of ODS outputs (Histogram is one of them), add the statement

 

ods trace on;

 

before running proc univariate and check the log.

PG

View solution in original post

1 REPLY 1
PGStats
Opal | Level 21

Simply add an ODS select statement :

 

proc univariate data=sashelp.bweight;
var weight;
class boy;
histogram weight / NORMAL;
ods select Histogram;
run;

To get the list of ODS outputs (Histogram is one of them), add the statement

 

ods trace on;

 

before running proc univariate and check the log.

PG

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 895 views
  • 1 like
  • 2 in conversation