The script is not too bad after all. This example shows one way that you could do it:
Names Default to Here( 1 );
// example case: Big Class
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// fit binary logistic model
lr = dt << Fit Model(
Y( :sex ),
Effects( :age, :height, :weight ),
Personality( "Nominal Logistic" ),
Run( Likelihood Ratio Tests( 1 ), Wald Tests( 0 ) )
);
// access Whole Model Test report
lr rep = (lr << Report)["Whole Model Test"];
// obtain likelihood for reduced and full models
L intercept = Exp( -(lr rep[NumberColBox(1)] << Get( 3 )) );
L full = Exp( -(lr rep[NumberColBox(1)] << Get( 2 )) );
N = lr rep[NumberColBox(8)] << Get( 1 );
// compute Cox-Snell R square
r sqr cs = 1 - (L intercept/L full)^(2/N);
// copy original report
label = lr rep[StringColBox(2)] << Insert Row( 2, { "RSquare (C-S)" } ) << Clone Box;
r sqr u = lr rep[NumberColBox(5)] << Get( 1 );
aicc = lr rep[NumberColBox(6)] << Get( 1 );
bic = lr rep[NumberColBox(7)] << Get( 1 );
// replace with new report
lr rep[Tablebox(2)] << Delete;
lr rep << Append(
TableBox(
label,
Number Col Box( "", { r sqr u, r sqr cs, aicc, bic, N } )
)
);