proc univariate data=numtem10;
VAR ACOSTY10;
histogram;
run;
ods select ParameterEstimates GoodnessOfFit FitQuantiles Bins MyPlot;
proc univariate data=numtem10;
histogram acosty / normal(percents=20 40 60 80 midpercents)
name='MyPlot distribution';
inset n normal(ksdpval) / pos = ne format = 6.3;
run;
my first one was able to generate a histogram but I want to add a curve to it. But the second cannot generate any figures.
Here is the error message. Any advice? Thanks.
**************
Output 'MyPlot' was not created. Make sure that the output object name, label, or path
is spelled correctly. Also, verify that the appropriate procedure options are used to
produce the requested output object. For example, verify that the NOPRINT option is not
used.
You may have excluded the graphs from ODS destinations. Try preceeding your proc univariate call with
ODS select all;
I tried two variables, acosty is the orginal variable, acosty10 is to break into deciles. None can generate a histogram with a normal curve.
In addition to the error message, there is a note below
NOTE: At least one W.D format was too small for the number to be printed. The decimal may be
shifted by the "BEST" format
Put the MIDPERCENTS option outside of the parentheses:
proc univariate data=sashelp.class;
var height weight;
histogram height weight / normal(percents=20 40 60 80) midpercents;
inset n normal(ksdpval) / pos = ne format = 6.3;
run;
Also, the NAME= option is only for traditional graphics. It doesn't do anything when you use ODS graphics.
I am unable to get a curve with your code. below is the note I got. The error message disappeared but the note is same
NOTE: At least one W.D format was too small for the number to be printed. The decimal may be
shifted by the "BEST" format.
The note about a format says that you have assigned a format that does not have enough positions to display the values you request.
a 6.3 format will display up to 99.999 (6 total characters with 3 decimals). If you variable is larger than 100 you would get that message. If the values much larger, say 1,000,000 you would get exponential notation such as 1E6.
So make the width of any formats used wider, try 9.3
NO curve nor histogram was generated.
1858 proc univariate data=numtem10;
1859 var acosty acost;
1860 histogram acosty acost / normal(percents=20 40 60 80) midpercents;
1861 inset n normal(ksdpval) / pos = ne format = 9.3;
1862 run;
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 3.16 seconds
cpu time 0.32 seconds
You may have excluded the graphs from ODS destinations. Try preceeding your proc univariate call with
ODS select all;
The note "At least one W.D format..." does not prevent the production of a graph. The problem is elsewhere. Please post the entire log for what you have tried.
For the one I am asking, I did not see any error message, but it just did not generate.
I did see another warning message on another statement
WARNING: Most ODS graphics with more than 5000 points have been suppressed. Use the
PLOTS(MAXPOINTS= ) option in the PROC REG statement to change or override the cutoff.
The message is self-explanatory. Making a graph with more than 5000 points will take some time and may not be very informative.
It is very important that you either
1) Post your data, or
2) Post any NOTEs, WARNINGs, or ERRORs that appear in the log.
Another suggestion: Please try to reproduce your problem by using a small data set such as Sashelp.Class. That will make it easier for those who are trying to diagnose your errors. For example, if you say "this code works with Sashelp.Class but does not work with my real data, that will let us know that the issue is with the data, not with the syntax.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.