BookmarkSubscribeRSS Feed
HansSteenhuis
Calcite | Level 5

does this graph also exist in SAS VIYA? Or can I make it myself?

 

On the x line I need the dates. On each day there are several points of the starting times.

 

I'm using the scatter chart now, but how can I get that linear line?

 

see example how it should be

 

grafiek_icm.JPG

7 REPLIES 7
BrunoMueller
SAS Super FREQ

Are you referring to SAS Visual analytics or some SAS program using Proc SGPLOT?

HansSteenhuis
Calcite | Level 5

I'm refering to SAS Viya

BrunoMueller
SAS Super FREQ
Are you using SAS visual Analytics to create the graph (all point and click) or are you writing a SAS program?

HansSteenhuis
Calcite | Level 5

Yes i'm using SAS Viya to create the graph

BrunoMueller
SAS Super FREQ

SAS Viya as answer does not help much. 

 

To create the graph are you using code like this:

proc sgplot data=sashelp.stocks;
  where
    stock = "IBM"
    and year(date) between 2004 and 2006
  ;
  scatter x=date y=close / ;
  reg x=date y=close / ;
run;

Creating this

Bruno_SAS_0-1679579175818.png

Or another way?

 

HansSteenhuis
Calcite | Level 5

Oh I'm using SAS visual Analytics to create the graph (all point and click)

BrunoMueller
SAS Super FREQ

In SAS Visual Analytics, the Scatter plot supports a "Fit Line", use either the right mouse button or the options pane to add it.

See https://documentation.sas.com/doc/en/vacdc/default/vaobj/n02h2a3i8htlhln1o4ngyz6f1ox5.htm#p0bvwvf3yy... for more details 

 

However the Scatter plot only supports measures. So currently there is no point and click way of creating such a graph using a measure and a date.

 

You could use the TreatAs operator to convert the date to a measure and then use it in the scatter plot, but you will loose the date information, but you would see the data points as well as the fit line.

 

Then there is always the Data Driven Content object that will allow to use for instance D3.js to do something like this or run some SAS code and generate a graph.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Discussion stats
  • 7 replies
  • 923 views
  • 0 likes
  • 2 in conversation