I'm trying to create a button that will modify the output of the Fit Model() dialog to include a Predicted R2 in the Summary of Fit table. I grab the current window and then I need to activate the PRESS statistic. After this it's straightforward enough and it mostly works if I've already activated the PRESS statistic through the contest menu. It also works if I code the Fit Model dialog myself and use line two to activate the PRESS statistic and then send it to the report. The issue I'm running into is that grabbing the Current Window() grabs a DisplayBox with no way to instruct the platform to do things. I considered just grabbing the script to make the window, closing the original and running a new one (one quick screen flicker isn't too bad) but the << Get Script returns the tree structure, not the Fit Model() script. Is there something easy I'm missing? I'm writing this in JMP 9, if that helps. I'm hoping it is JMP 8 compatible, but that's not important. Thanks!
dg = Current Window();dg << PRESS; /###/press = dg[NumberColBox("Press RMSE")] << Get as Matrix;press = press[1];ss = dg[NumberColBox("Sum of Squares")] << Get as Matrix;lastrow = Nrow(ss);sst = ss[lastrow];predR = 1-press/sst;values = dg[NumberColBox(1)] << Get as Matrix;newvalues = J(1,6);newvalues[1::2] = values[1::2];newvalues[3] = predR;newvalues[4::6] = values[3::5];dg[StringColBox(1)] << Set Values({"RSquare","RSquare Adj","RSquare Pred","Root Mean Square Error","Mean of Response","Observations (or Sum Wgts)"});dg[NumberColBox(1)] << Set Values(newvalues);