Estoy tratando de escribir un jsl para trazar un gráfico bivariado entre x vs. y, agrupar por los valores en la columna 'b' y ajustar una línea a través de cada uno de los grupos (de los valores únicos en la columna 'b'). El script generado a partir del diagrama bivariado manual que hice es el siguiente, pero no puedo entender cómo agregar un bucle for para todos los comandos "Fit Where" que pasan por los valores únicos en la columna 'b'
Bivariate(
Y( :Name( "y" ) ),
X( :Name( "x" ) ),
Automatic Recalc( 1 ),
Fit Where( :p</img> == "grpA", Fit Line( {Line Color( {228, 26, 28} )} ) ),
Fit Where(
:p</img> == "grpB",
Fit Line( {Line Color( {55, 126, 184} )} )
),
Fit Where(
:p</img> == "grpC",
Fit Line( {Line Color( {77, 175, 74} )} )
),
Fit Where(
:p</img> == "grpD",
Fit Line( {Line Color( {152, 78, 163} )} )
),
Fit Where(
:p</img> == "grpE",
Fit Line( {Line Color( {255, 127, 0} )} )
),
Fit Where(
:p</img> == "grpF",
Fit Line( {Line Color( {166, 86, 40} )} )
),
Where( :c == "TT" & :e == "EE" ),
SendToReport(
Dispatch( {}, "1", ScaleBox, {Reversed Scale} ),
Dispatch( {}, "2", ScaleBox, {Reversed Scale} ),
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Marker Size( 6 ), Row Legend(
e,
Color( 0 ),
Color Theme( "" ),
Marker( 1 ),
Marker Theme( "Standard" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch( {}, "Linear Fit b==grpA, OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Linear Fit b==grpB", OutlineBox, {Close( 1 )} ),
Dispatch(
{},
"Linear Fit b==grpC",
OutlineBox,
{Close( 1 )}
),
Dispatch(
{},
"Linear Fit b==grpD",
OutlineBox,
{Close( 1 )}
),
Dispatch(
{},
"Linear Fit b==grpE",
OutlineBox,
{Close( 1 )}
),
Dispatch(
{},
"Linear Fit b==grpF",
OutlineBox,
{Close( 1 )}
)
)
);