I apologise if this posts twice. My first post seems to have vanished.
Using Big Class as an example: plot height vs weight but only show correlation using Female data points.
Interactively:
- in the data table, select Male data rows and exclude (but NOT hide),
- in Graph Builder: plot height against weight, set sex as Overlay variable, change smoother to line of fit, then with the SHIFT key pressed select "Show Excluded Rows" from the red triangle menu (shift is needed to unhide this usually hidden option).
Using scripting, with a local data filter this time instead of modifying the table:
Names Default to here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
dt << Graph Builder(
Size( 300, 200 ),
Show Control Panel( 0 ),
Show Excluded Rows( 1 ),
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements(
Points( X, Y, Legend( 3 ) ),
Line Of Fit( X, Y, Legend( 5 ), R²( 1 ) )
),
Local Data Filter(
Show Controls( 0 ),
Mode( Show( 0 ) ),
Add Filter( columns( :sex ), Where( :sex == "F" ) )
)
);
Hope this helps!