Here is an example using the semiconductor capability data table. The data points being plotted are not as organized as your data, however, the example show how to plot all data points on the Regression Plot
Names Default To Here( 1 );
dt =
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
dt:wafer << modeling type( ordinal );
Data Table( "Semiconductor Capability" ) << Data Filter(
Location( {890, 387} ),
Mode( Show( 1 ) ),
Mode( Include( 1 ) ),
Add Filter(
columns( :wafer ),
Where( :wafer == 1 ),
Display( :wafer )//, N Items(target_values))
)
);
fm = Data Table( "Semiconductor Capability" ) << Fit Model(
SendToByGroup( Bygroup Default ),
Y( :NPN1 ),
By( :Site ),
Effects( :PNP1 ),
Personality( "Standard Least Squares" ),
//Emphasis( "Effect Leverage" ),
Run(
:NPN1 << {Summary of Fit( 0 ), Analysis of Variance( 0 ), Parameter Estimates( 0 ), Lack of Fit( 0 ),
Scaled Estimates( 0 ), Plot Actual by Predicted( 0 ), Plot Residual by Predicted( 0 ),
Plot Studentized Residuals( 0 ), Plot Effect Leverage( 0 ), Plot Residual by Normal Quantiles( 0 ),
Box Cox Y Transformation( 0 )}
),
Automatic Recalc( 1 )
);
Summarize( byvals = by( :site ) );
For Each( {level}, byvals,
fmr = Report( fm[Num( level )] );
fmr["Regression Plot", framebox( 1 )] << add graphics script(
theVals = dt:NPN2 << get values;
For Each( {val, theRow}, theVals,
colorList = {"Red", "Green", "Blue", "Orange", "Yellow"};
x = "fill color( \!"" || Char( Eval( colorList[dt:site[theRow]] ) ) || "\!");";
Eval( Parse( x ) );
thematrix = {};
Insert Into( thematrix, dt:PNP1[theRow] );
Insert Into( thematrix, val );
Transparency( 1 );
Circle( PixelRadius( 3 ), thematrix, "FILL" );
);
);
);
Jim