Col Box
Col Box using Run Script
Example 1
Summary: Generates a Bivariate analysis report with formatted parameter estimates and saves it to a temporary file.
Code:
dt = Open("data_table.jmp");
biv = dt << Run Script( "Bivariate" );
Report( biv )["Linear Fit", "Parameter Estimates", Number Col Box( "Std Error" )] << Set Format( "Best", 6 );
Report( biv ) << Save Window Report( "$TEMP/platform.jrp", embed data( 0 ) );
Report( biv ) << Close Window;
Code Explanation:
- Open data table.
- Run Bivariate analysis script.
- Format parameter estimates.
- Save report to temporary file.
- Close Bivariate window.
Example 2
Summary: Generates a Bivariate analysis report, formatting linear fit parameters and saving to a temporary file.
Code:
dt = Open("data_table.jmp");
biv = dt << Run Script( "Bivariate" );
Report( biv )["Linear Fit", "Parameter Estimates", Number Col Box( "Std Error" )] << Set Format( "Best", 6 );
Report( biv ) << Save Window Report( "$TEMP/platform.jrp", embed data( 0 ) );
Report( biv ) << Close Window;
Open( "$TEMP/platform.jrp" );
Code Explanation:
- Open data table;
- Run Bivariate analysis script.
- Format linear fit report.
- Save report to temporary file.
- Close Bivariate window.
- Open saved report file.
Example 3
Summary: Executes a SEM script with Bollen (1989) MIIV-2SLS Estimator and configures model diagnostics for analysis.
Code:
dt = Open("data_table.jmp");
dt << Run Script( "SEM: Bollen (1989) MIIV-2SLS Estimator" );
rpt = Current Report();
modelCompOpen = rpt["Model Diagnostics"] << set open;
rpt["Model Specification", Tab Page Box( 3 ), String Col Box( "Name" )] << set selected rows( [2] );
Code Explanation:
- Open data table.
- Run SEM script.
- Get current report.
- Open model diagnostics.
- Select specific row in report.
Example 4
Summary: Runs the extraction and conversion of a parametric survival fit report from a script, retrieving the fourth column box as a matrix.
Code:
dt = Open("data_table.jmp");
ps = dt << Run Script( "Fit Parametric Survival" );
cv = Report( ps )["Parametric Survival Fit"][Number Col Box( 4 )] << get as matrix;
Code Explanation:
- Open table.
- Run script "Fit Parametric Survival".
- Extract report from script.
- Access "Parametric Survival Fit" section.
- Get fourth column box.
- Convert to matrix.
- Assign to variable cv.
Example 5
Summary: Runs the extraction and conversion of a Whole Model section from a Proportional Hazards script report, returning the result as a matrix.
Code:
dt = Open("data_table.jmp");
ph = dt << Run Script( "Fit Proportional Hazards" );
wm = Report( ph )["Whole Model"][Number Col Box( 1 )] << get as matrix;
Code Explanation:
- Open table.
- Run script "Fit Proportional Hazards".
- Extract report from script.
- Access "Whole Model" section.
- Get first number column box.
- Convert to matrix.
- Assign to variable wm.
Col Box using Log Capture
Example 1
Summary: Process of running a script, capturing the report object, and extracting summary data from a JMP data table.
Code:
dt = Open("data_table.jmp");
Log Capture( obj = dt << Run Script( "Fit Life by X" ) );
rp = Report( obj );
summdata = rp["Summary of Data"][Number Col Box( 1 )] << get as matrix;
Code Explanation:
- Open data table.
- Run script "Fit Life by X".
- Capture report object.
- Extract summary report.
- Retrieve data from box.
- Convert to matrix.
Example 2
Summary: Process of setting missing value codes, running a script, capturing report summaries, and reverting data tables for multiple columns.
Code:
dt = Open("data_table.jmp");
Log Capture(
dt:Sold Quantity << Set Property( "Missing Value Codes", 2600 );
rf1 = dt << Run Script( "Nevada Format" );
rv1 = Report( rf1 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
dt:Sold Quantity[dt << get rows where( Col Stored Value( :Sold Quantity ) == 2600 )] = .;
rf2 = dt << Run Script( "Nevada Format" );
rv2 = Report( rf2 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
dt = dt << Revert;
dt:Sold Month << Set Property( "Missing Value Codes", 3345148800 );
rf1 = dt << Run Script( "Nevada Format" );
rv1 = Report( rf1 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
dt:Sold Month[7] = .;
rf2 = dt << Run Script( "Nevada Format" );
rv2 = Report( rf2 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
dt = dt << Revert;
dt:"01/2010" << Set Property( "Missing Value Codes", {18, 6} );
rf1 = dt << Run Script( "Nevada Format" );
rv1 = Report( rf1 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
dt:"01/2010"[{1, 6}] = .;
rf2 = dt << Run Script( "Nevada Format" );
rv2 = Report( rf2 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
);
Code Explanation:
- Open data table.
- Set missing value code.
- Run script "Nevada Format".
- Capture report summary.
- Replace values with missing.
- Run script again.
- Capture new report summary.
- Revert data table.
- Set another missing value code.
- Repeat steps 3-8 for different columns.
Example 3
Summary: Process of running 'Fit Life by X' script on a data table, capturing summary reports, and manipulating missing values in Hours and Censor columns.
Code:
dt = Open("data_table.jmp");
Log Capture(
dt:Hours << Set Property( "Missing Value Codes", {1298, 1390, 3187} );
flbx1 = dt << Run Script( "Fit Life by X" );
rvec1 = Report( flbx1 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
dt:Hours[2 :: 4] = .;
flbx2 = dt << Run Script( "Fit Life by X" );
rvec2 = Report( flbx2 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
dt = dt << Revert;
dt:Temp << Set Property( "Missing Value Codes", {40} );
flbx1 = dt << Run Script( "Fit Life by X" );
rvec1 = Report( flbx1 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
dt:Temp[dt << get rows where( Col Stored Value( :Temp ) == 40 )] = .;
flbx2 = dt << Run Script( "Fit Life by X" );
rvec2 = Report( flbx2 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
(dt << select where( Is Missing( :Temp ) )) << delete rows;
flbx3 = dt << Run Script( "Fit Life by X" );
rvec3 = Report( flbx3 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
dt = dt << Revert;
dt:Censor << Delete Formula;
dt:Censor[2 :: 4] = 3;
dt:Censor << Set Property( "Missing Value Codes", {3} );
flbx1 = dt << Run Script( "Fit Life by X" );
rvec1 = Report( flbx1 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
dt:Censor[dt << get rows where( Col Stored Value( :Censor ) == 3 )] = .;
flbx2 = dt << Run Script( "Fit Life by X" );
rvec2 = Report( flbx2 )["Summary of Data"][Number Col Box( 1 )] << get as matrix;
);
Code Explanation:
- Open data table.
- Set missing value codes for Hours.
- Run "Fit Life by X" script.
- Capture summary report.
- Introduce missing values in Hours.
- Repeat "Fit Life by X".
- Capture second summary report.
- Revert data table.
- Set missing value codes for Temp.
- Run "Fit Life by X" again.
- Capture third summary report.
- Remove rows with missing Temp.
- Run "Fit Life by X" one more time.
- Capture fourth summary report.
- Revert data table.
- Delete Censor formula.
- Introduce missing values in Censor.
- Set missing value codes for Censor.
- Run "Fit Life by X" script.
- Capture fifth summary report.
- Remove rows with missing Censor.
- Run "Fit Life by X" last time.
- Capture sixth summary report.
Col Box using N Col
Summary: Analyze and visualize a binomial elastic net model, generating predicted probabilities for low and high severity outcomes, and calculating expected profits based on validation data.
Code:
dt = Open("data_table.jmp");
n1 = N Col( dt );
fm = dt << Run Script( "Elastic Net Binomial, Validation Column" );
fm << (Fit[1] << Save Prediction Formula);
rp = Report( fm )["Binomial Adaptive Elastic Net with Validation Column"];
val = rp[Number Col Box( "Validation" )] << get as matrix;
lnz = Loc( rp[Number Col Box( "Estimate" )] << get as matrix );
pred = (dt:Name( "Probability(Severity=Low)" ) << get values)[1];
val exp = [42, 42, 25.7686441526887, 10, 88.9139844882111, 78.6340624989258, 0.131857261916875];
nonzero = [1, 3, 4, 6, 7, 12, 13, 14, 17, 20];
obs1pred = 0.448130177304281;
n2 = N Col( dt );
pred_high = dt:Name( "Probability(Severity=High)" ) << get values;
pred_low = dt:Name( "Probability(Severity=Low)" ) << get values;
dt:Severity << Set Property( "Profit Matrix", {[1 - 2, -1 1, . .], {"High", "Low", "Undecided"}} );
fm << (Fit[1] << Save Prediction Formula);
n3 = N Col( dt );
pred_high2 = dt:Name( "Probability(Severity=High) 2" ) << get values;
pred_low2 = dt:Name( "Probability(Severity=Low) 2" ) << get values;
form = dt:Most Likely Severity 2 << get formula;
prof_high = dt:Profit for High << get values;
prof_low = dt:Profit for Low << get values;
profit_form = dt:Most Profitable Prediction for Severity << get formula;
exp_form = dt:Expected Profit for Severity << get formula;
act_form = dt:Actual Profit for Severity << get formula;
Code Explanation:
- Open data table;
- Count columns in dataset.
- Run elastic net binomial model.
- Save prediction formula.
- Extract validation report.
- Get validation column as matrix.
- Locate non-zero estimates.
- Get predicted probability for low severity.
- Define expected validation values.
- Define non-zero index list.
Col Box using New Window
Example 1
Summary: Creates interactive windows with nested popup boxes and collapsible tables using JMP Scripting Language (JSL).
Code:
Names Default To Here( 1 );
//ex1: nest popup boxes into a table box
New Window( "test",
Table Box(
Col Span Box(
"Col Span",
Number Col Box( "", {1, 2, 3} ),
Col Box ( "",
Popup Box( {"x", ex = 1, "y", ex = 2} ),
Popup Box( {"x", ex = 1, "y", ex = 2} ),
Popup Box( {"x", ex = 1, "y", ex = 2} )
)
),
string col box ("ABC", {"a", "b", "c"})
)
);
//ex2: a collapsible table
New Window( "test",
Outline Box( "test",
Table Box (
Number Col Box( "", {1, 2, 3} ),
String Col Box( "ABC", {"a", "b", "c"} ),
<< set column borders (1),
<< set row borders (1)
)
)
);
//ex3: collapsible table with nested popups
New Window( "test",
Outline Box( "test",
Table Box(
Col Span Box(
"Col Span",
Number Col Box( "", {1, 2, 3} ),
Col Box ( "",
Popup Box( {"x", ex = 1, "y", ex = 2} ),
Popup Box( {"x", ex = 1, "y", ex = 2} ),
Popup Box( {"x", ex = 1, "y", ex = 2} )
)
),
string col box ("ABC", {"a", "b", "c"}),
<< set column borders (1),
<< set row borders (1)
)
)
);
Code Explanation:
- Set default name scope.
- Create new window "test".
- Add table box to window.
- Add column span box.
- Add number column box with data.
- Add column box with three popup boxes.
- Add string column box with data.
- Create new window "test".
- Add outline box to window.
- Add table box with number and string columns.
- Set column borders.
- Set row borders.
- Create new window "test".
- Add outline box to window.
- Add table box with column span box.
- Add number column box with data.
- Add column box with three popup boxes.
- Add string column box with data.
- Set column borders.
- Set row borders.
Example 2
Summary: Creates a new window with two table boxes, one for interval plots and one for bar plots, setting lower and upper bounds for each plot style.
Code:
nw = New Window( "Example",
Table Box( pcb1 = Plot Col Box( "Interval", {25, 40, 5, 10, 10, 5} ) ),
Table Box( pcb2 = Plot Col Box( "Bar", {25, 45, 5, 10, 10, 5} ) )
);
//Interval
pcb1 << Lower( [20, 30, 0, 5, 5, 0] );
pcb1 << Upper( [30, 50, 10, 15, 15, 10] );
pcb1 << Set Plot Style( Interval );
//Bar
pcb2 << Lower( [20, 30, 0, 5, 5, 0] );
pcb2 << Upper( [30, 50, 10, 15, 15, 10] );
pcb2 << Set Plot Style( Bar );
Code Explanation:
- Create new window.
- Add table box with interval plot.
- Add table box with bar plot.
- Set lower bounds for interval plot.
- Set upper bounds for interval plot.
- Apply interval style to plot.
- Set lower bounds for bar plot.
- Set upper bounds for bar plot.
- Apply bar style to plot.