BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a chart I want to generate

the chart is basically a scatter plot with points connected with two sets of data.
the first is the measured data and the second is the estimates from a regression.

the independent axis is time

I can plot one set of points OK but when I try to plot the second set of points the interpolated straight line goes from following the values across time to zigzagging back and forth across the plot. I can't find any control in the eg interface to correct this problem. Do I have to do this in code?
2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12
I think that you just need to sort the data by the values in the predicted line.

You may be able to do this as one of the Plot options of one of the regression tasks.
deleted_user
Not applicable
after going back and forth with SAS support I had to do it in code

the GUI wanted put in an sql sort even though I had the data sorted correctly the sql sort messed everything up. There seemed also to be no way around have the sort not included

I also had to code a macro variable to set the limits of the axis correctly. GPlot likes to scale each vertical axis independently. You can overcome this by putting an order= in an axis statement with the min max values but as I don't know ahead what the correct max value I had to code something like

max = rounde(max(avgvol,predicted_avgvol),100)+int(rounde(max(avgvol,predicted_avgvol),100))/5;

and then stick it into a macro variable then run my plot code through a macro to get the scales set correctly

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 698 views
  • 0 likes
  • 2 in conversation