cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

make Smoother in Graph Builder a scriptable object

I frequently save the spline smoother formula from Graph Builder with overlay of a categorical variable and then save the formula to the data table because of the noise in my data. I use it so often that I would like to be able to script it.  After having checked the section of the Scripting Guide about  Executing Embedded Red Triangle options, I cannot see the Smoother as a scriptable object. Please make saving the spline smoother formula something that I can do from JSL. I do realize that it is possible to use a spline function from the Bivariate platform with a By variable. I do like the default spline fit in Graph Builder better.

2 Comments
ih
Super User (Alumni)
Super User (Alumni)

As information, to get the same line from graph builder in Bivariate, choose 'Other...' under the Red Triangle > Flexible > Fit Spline, use a lamda of 0.05 (default in graph builder) and check 'Standardize X'.

 

ih_0-1632684190309.png

 

 

XanGregg
Staff

I think this question was superseded by your related question that I answered, so I'll post the same JSL for anyone coming across just this one. Though I hope this script does what you want, it's still true that there's no Smoother object per se.

gb = Graph Builder(
	Variables( X( :height ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 2 ) ), Smoother( X, Y, Legend( 3 )) )
);
gbb = Report( gb )[Graph Builder Box( 1 )];
gbb << Update Element( 1, 1, 2, {Save Formula} );