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

I'm having trouble running the following code in SAS 9.4:

 

proc univariate data=lea;
var starttime;
cdfplot starttime / vref=1779111938;
run;

The code runs and I get the default univariate output as well as the plot but the reference line is not on there. The CDFPLOT part is in red text in the editor and 'vref' is not in blue. This leads me to believe that the procedure is not working propery as other options such as HISTOGRAM and QQPLOT do work (turn blue and produce plots).

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Using SAS UE, which is 9.4, I don't see any issues.

 

Here's my code, if you have issues with this then I would highly suggest you contact SAS Tech support. 

 

Do note that if you have your VREF out of the range of your data then it won't show up on the graph.

 

proc  univariate data=sashelp.class;
var weight;
cdfplot weight/vref=40;
run;quit;

proc  univariate data=sashelp.class;
var weight;
cdfplot weight/vref=150;
run;quit;

View solution in original post

4 REPLIES 4
Reeza
Super User

Using SAS UE, which is 9.4, I don't see any issues.

 

Here's my code, if you have issues with this then I would highly suggest you contact SAS Tech support. 

 

Do note that if you have your VREF out of the range of your data then it won't show up on the graph.

 

proc  univariate data=sashelp.class;
var weight;
cdfplot weight/vref=40;
run;quit;

proc  univariate data=sashelp.class;
var weight;
cdfplot weight/vref=150;
run;quit;
swain
Calcite | Level 5

Thank you. I erroneously interpreted VREF to mean a vertical reference line, not for the vertical axis.

Rick_SAS
SAS Super FREQ

Don't worry about certain keywords appearing in red. Sometimes the color-coding in a program edsitor is not perfect. CDFPLOT is a valid statement, as you can see by consulting the documentation for PROC UNIVARIATE.

 

Regarding the REF= statement, your code will be more understandable and less prone to error if you specify the reference line in a human-readable format. For example:

 

cdfplot starttime / vref='17May2016:13:45:38'dt;

 

Make sure that you use the same format as is used for the STARTTIME variable. For example, another possibility is 

vref='17May2016'd;

 

 

swain
Calcite | Level 5

Thank you, this helped me figure it out.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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