Break
Break using For
Summary: Generates a distribution analysis for continuous variables in the specified data table using the Distribution platform, identifying outlying rows and replacing values as needed.
Code:
// Clean Out Error Codes
// Open data table
dt = Open("data_table.jmp");
// Clean Out Error Codes
For( icol = 8, icol <= 394, icol++,
col = Column( icol );
vec = col << GetAsMatrix;
nr = N Row( vec );
Tail = 0.1;
For( i = 1, i < 8, i++,
PL = Tail;
PU = 1 - Tail;
QLower = Quantile( PL, vec );
QUpper = Quantile( PU, vec );
If( QLower < QUpper, Break() );
Tail = Tail / 2;
);
QRange = QUpper - QLower;
funnyRows =
Loc(
(vec > QUpper + 20 * QRange | vec
< QLower - 20 * QRange) & vec
== Floor( vec )
);
nFix = N Row( funnyRows );
If( nFix == 0, Continue() );
Show(
" ",
col << GetName,
QLower,
QUpper,
vec[funnyRows]
);
For( i = 1, i <= nfix, i++,
col[funnyRows[i]] = .
);
);
Code Explanation:
- Open data table.
- Initialize column index.
- Loop through columns.
- Get column matrix.
- Calculate number of rows.
- Set initial tail value.
- Loop through initial quantiles.
- Calculate lower and upper quantiles.
- Check quantile condition.
- Calculate quantile range.
- Identify outlying rows.
- Count fixable rows.
- Skip if no fix needed.
- Display column details.
- Replace outlying values.
Break using Run Script
Summary: Fits a parametric survival model, extracting parameter estimates, and adjusting for original predictors in JMP Pro.
Code:
dt = Open("data_table.jmp");
obj = dt << Run Script( "Fit Parametric Survival" );
rpt = obj << report;
est = rpt[Outline Box( "Parameter Estimates" )][Table Box( 1 )] << get as matrix;
If( JMP Product Name() == "Pro",
rpt["Parameter Estimates"][Button Box( 1 )] << Click;
For( i = 1, i <= N Items( Window() ), i++,
If( Window()[i] << get window title == "Report: Fit Model",
Window()[i][Button Box( 9 )] << Click;
rpt1 = Current Report();
Break();
)
);
est1 = rpt1[Outline Box( "Parameter Estimates for Original Predictors" )][Table Box( 1 )] << get as matrix;
scale1 = rpt1[Outline Box( "Parameter Estimates for Original Predictors" )][Table Box( 2 )] << get as matrix;
);
Code Explanation:
- Open data table.
- Run parametric survival script.
- Extract parameter estimates report.
- Convert estimates to matrix.
- Check if JMP version is Pro.
- Click on parameter estimates button.
- Loop through all windows.
- Find "Report: Fit Model" window.
- Click on "Confidence Limits" button.
- Extract original parameter estimates and scale matrices.