BookmarkSubscribeRSS Feed
sc5
Fluorite | Level 6 sc5
Fluorite | Level 6

Hi, 

 

Is there a way I can access the coefficients of a linear fit through a scatter plot and use it in calculations displayed in a report?

 

E.g. I have 2 scatter plots, both controlled by a set of List controls. Every time I change the list selection, the data displayed and the fit lines on both plots change. 

 

sc5_0-1714541272010.pngsc5_1-1714541272072.png

 

 

 

is there any way to display a table (example below) with the difference between the calculated y-values from both fit lines at certain x-values?

This table would dynamically update every time the list control selection changes, and it would be displayed on the main report page.

sc5_0-1714544015737.png

 

 

Essentially, are the intercept, slope and R-square stored anywhere as objects I can reference? Like can I create a parameter as @chartobject.slope or something?

I can see them when I maximise the chart object, but I don't see a way to display them dynamically updating as part of the main report page.

 

sc5_2-1714541272005.png

 

 

In Excel this is easy with pivot tables. Slicers control charts connected to the pivot tables, and formulas =intercept(<y_col>,,x_col>), =slope(<y_col>,,x_col>) capture the trendline dynamically in cells anywhere I want. 

I don't want to have to export a regression / run code / refresh the report / etc., the aim is just to do some quick interactive analysis in the report as we slice data on-the-fly. 

Thank you!

 
1 REPLY 1
Stu_SAS
SAS Employee

Hey there again @sc5! Unfortunately there is not a way to access these coefficients programmatically the way that you are describing. You are correct that the coefficients do display when you maximize the object and the values will dynamically change with controls, but currently they are only visible within the Analysis section of the maximized scatterplot. Since the scatterplot supports a matrix of scatterplots, you will receive a line and set of coefficients for each combination of values.

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!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 344 views
  • 0 likes
  • 2 in conversation