Diagram
Diagram using Neural
Example 1
Summary: Uses the Neural platform to build a neural network model that predicts percent body fat based on various anthropometric measurements, with validation and robust fit options enabled.
Code:
// Neural (3,0,0): 1 layer
// Open data table
dt = Open("data_table.jmp");
// Neural (3,0,0): 1 layer
Neural(
Y( :Percent body fat ),
X(
:"Age (years)"n, :"Weight (lbs)"n,
:"Height (inches)"n,
:"Neck circumference (cm)"n,
:"Chest circumference (cm)"n,
:"Abdomen circumference (cm)"n,
:"Hip circumference (cm)"n,
:"Thigh circumference (cm)"n,
:"Knee circumference (cm)"n,
:"Ankle circumference (cm)"n,
:
"Biceps (extended) circumference (cm)"n,
:"Forearm circumference (cm)"n,
:"Wrist circumference (cm)"n
),
Validation( :Validation ),
Missing Value Coding( 1 ),
Transform Covariates( 1 ),
Fit(
NTanH( 3 ),
Transform Covariates( 1 ),
Robust Fit( 1 ),
Diagram( 1 )
)
);
Code Explanation:
- Open data table.
- Define neural network model.
- Set response variable.
- List predictor variables.
- Specify validation column.
- Enable missing value coding.
- Transform covariates.
- Begin fitting process.
- Use TanH activation function.
- Generate neural network diagram.
Example 2
Summary: Uses the Neural platform to model the relationship between various anthropometric measurements and percent body fat, utilizing a 2-layer neural network with robust fitting and diagram generation.
Code:
// Neural (4,0,0), (8,0,0): 2 layers
// Open data table
dt = Open("data_table.jmp");
// Neural (4,0,0), (8,0,0): 2 layers
Neural(
Y( :Percent body fat ),
X(
:"Age (years)"n, :"Weight (lbs)"n,
:"Height (inches)"n,
:"Neck circumference (cm)"n,
:"Chest circumference (cm)"n,
:"Abdomen circumference (cm)"n,
:"Hip circumference (cm)"n,
:"Thigh circumference (cm)"n,
:"Knee circumference (cm)"n,
:"Ankle circumference (cm)"n,
:
"Biceps (extended) circumference (cm)"n,
:"Forearm circumference (cm)"n,
:"Wrist circumference (cm)"n
),
Validation( :Validation ),
Missing Value Coding( 1 ),
Transform Covariates( 1 ),
Fit(
NTanH( 4 ),
NTanH2( 8 ),
Transform Covariates( 1 ),
Robust Fit( 1 ),
Diagram( 1 )
)
);
Code Explanation:
- Open data table.
- Define neural network model.
- Set response variable.
- List predictor variables.
- Specify validation method.
- Handle missing values.
- Transform covariates.
- Begin fit configuration.
- Define first hidden layer.
- Define second hidden layer.
- Transform covariates again.
- Enable robust fitting.
- Generate diagram.
Example 3
Summary: Performs a neural network analysis to predict percent body fat using various anthropometric measurements, with validation and robust fit options enabled.
Code:
// Neural Boosted
// Open data table
dt = Open("data_table.jmp");
// Neural Boosted
Neural(
Y( :Percent body fat ),
X(
:"Age (years)"n, :"Weight (lbs)"n,
:"Height (inches)"n,
:"Neck circumference (cm)"n,
:"Chest circumference (cm)"n,
:"Abdomen circumference (cm)"n,
:"Hip circumference (cm)"n,
:"Thigh circumference (cm)"n,
:"Knee circumference (cm)"n,
:"Ankle circumference (cm)"n,
:
"Biceps (extended) circumference (cm)"n,
:"Forearm circumference (cm)"n,
:"Wrist circumference (cm)"n
),
Validation( :Validation ),
Missing Value Coding( 0 ),
Transform Covariates( 1 ),
Fit(
NTanH( 1 ),
Transform Covariates( 1 ),
Robust Fit( 1 ),
N Boost( 100 ),
Diagram( 1 )
)
);
Code Explanation:
- Open data table.
- Define neural network model.
- Set response variable.
- Specify predictor variables.
- Use validation column.
- Code missing values as zero.
- Transform covariates.
- Begin fitting process.
- Apply TanH activation function.
- Perform robust fit.
Example 4
Summary: Generates a neural network analysis to identify significant factors affecting Y, utilizing the Neural platform with holdback validation and informative missing handling disabled.
Code:
dt = Open("data_table.jmp");
n = dt << Neural(
Y( :Y ),
X( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Informative Missing( 0 ),
Validation Method( "Holdback", 0.3333 ),
Fit( NTanH( 3 ), Show Estimates( 1 ), Diagram( 1 ) )
);
Report( n )[Node Graph Box( 1 )] << Background Color( "Light Yellow" );
Code Explanation:
- Open data table;
- Perform neural network analysis.
- Set Y variable.
- Select X variables.
- Disable informative missing handling.
- Use holdback validation method.
- Set holdback percentage to 33.33%.
- Fit model with 3 layers.
- Show parameter estimates.
- Display node diagram.
- Change background color to light yellow.
Example 5
Summary: Generates a neural network analysis to identify significant factors affecting the Y variable, utilizing holdback validation and displaying node graph estimates.
Code:
dt = Open("data_table.jmp");
n = dt << Neural(
Y( :Y ),
X( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Informative Missing( 0 ),
Validation Method( "Holdback", 0.3333 ),
Fit( NTanH( 3 ), Show Estimates( 1 ), Diagram( 1 ) )
);
Report( n )[Node Graph Box( 1 )] << Background Color( "Light Yellow" );
n << Journal;
Code Explanation:
- Open data table;
- Create neural network model.
- Set Y variable.
- Define X variables.
- Disable informative missing.
- Use holdback validation.
- Set holdback ratio.
- Fit NTanh model.
- Show parameter estimates.
- Display node diagram.
- Change background color.
- Save report to journal.
Example 6
Summary: Generates a neural network analysis to predict percent body fat using multiple anthropometric measurements, utilizing the Neural platform in JMP.
Code:
dt under test = Open("data_table.jmp");
obj = Neural(
Y( :Percent body fat ),
X(
:Name( "Age (years)" ), :Name( "Weight (lbs)" ), :Name( "Height (inches)" ), :Name( "Neck circumference (cm)" ),
:Name( "Chest circumference (cm)" ), :Name( "Abdomen circumference (cm)" ), :Name( "Hip circumference (cm)" ),
:Name( "Thigh circumference (cm)" ), :Name( "Knee circumference (cm)" ), :Name( "Ankle circumference (cm)" ),
:Name( "Biceps (extended) circumference (cm)" ), :Name( "Forearm circumference (cm)" ), :Name( "Wrist circumference (cm)" )
),
Validation( :Validation ),
Missing Value Coding( 1 ),
Transform Covariates( 1 ),
Fit( NTanH( 4 ), NTanH2( 8 ), Transform Covariates( 1 ), Robust Fit( 1 ), Diagram( 1 ) )
);
Code Explanation:
- Open data table;
- Define neural network model.
- Set response variable.
- Specify predictor variables.
- Use validation column.
- Handle missing values.
- Transform covariates.
- Fit neural network.
- Use TanH activation.
- Display diagram.
Diagram using Ensemble Model
Summary: Opens a data table, defines a neural model with multiple algorithms, and fits the non-linear model using KFold validation. The script also enables profiling and shows confidence intervals for each term.
Code:
// Ensemble Model (Neural weighted)
// Open data table
dt = Open("data_table.jmp");
// Ensemble Model (Neural weighted)
Neural(
Y( :Percent body fat ),
X(
:
"Pred Body Fat - Variable Reduction PCA"n,
:"Pred Body Fat - Stepwise"n,
:"Pred Body Fat - Partition"n,
:"Pred Body Fat - PLS"n,
:
"Pred Body Fat - Bootstrap Forest"n,
:"Pred Body Fat - Boosted Tree"n,
:
"Pred Body Fat - Neural (3,0,0)"n,
:
"Pred Body Fat - Neural (4,0,0),(8,0,0)"n,
:
"Pred Body Fat - Boosted Neural"n
),
Missing Value Coding( 0 ),
Validation Method( "KFold", 10 ),
Fit(
NLinear( 1 ),
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
"Pred Body Fat - Variable Reduction PCA"n(
8.69998731198556,
Lock( 0 ),
Show( 1 )
),
"Pred Body Fat - Stepwise"n(
19.151,
Lock( 0 ),
Show( 1 )
),
"Pred Body Fat - Partition"n(
18.852,
Lock( 0 ),
Show( 1 )
),
"Pred Body Fat - PLS"n(
18.859,
Lock( 0 ),
Show( 1 )
),
"Pred Body Fat - Bootstrap Forest"n(
18.796,
Lock( 0 ),
Show( 1 )
),
"Pred Body Fat - Boosted Tree"n(
18.821,
Lock( 0 ),
Show( 1 )
),
"Pred Body Fat - Neural (3,0,0)"n(
18.091,
Lock( 0 ),
Show( 1 )
),
"Pred Body Fat - Neural (4,0,0),(8,0,0)"n(
18.627,
Lock( 0 ),
Show( 1 )
),
"Pred Body Fat - Boosted Neural"n(
18.604,
Lock( 0 ),
Show( 1 )
)
)
),
Diagram( 1 )
)
);
Code Explanation:
- Open table.
- Define neural model.
- Set response variable.
- Specify predictor variables.
- Configure missing value coding.
- Select validation method.
- Fit non-linear model.
- Enable profiler.
- Show confidence intervals.
- Set term values and lock.
Example 1
Summary: Opens a data table and creates a diagram based on the relationship between 'Child' and 'Parent' variables.
Code:
// Diagram
// Open data table
dt = Open("data_table.jmp");
// Diagram
Diagram( Y( :Child ), X( :Parent ) );
Code Explanation:
- Open data table.
- Create diagram.
Example 2
Summary: Creates and saves a diagram from a data table, with Y-axis set to Child and X-axis set to Parent.
Code:
dt = Open("data_table.jmp");
obj = dt << Diagram( Y( :Child ), X( :Parent ) );
Report( obj ) << Save Window Report( "$TEMP/nodt_diagram.jrp", embed data( 0 ) );
Report( obj ) << Close Window;
Code Explanation:
- Open data table;
- Create diagram object.
- Set Y variable to Child.
- Set X variable to Parent.
- Save window report to .jrp file.
- Embed data set to 0.
- Close the window.
Example 3
Summary: Creates and saves a diagram from a data table, utilizing Y and X variables to define the plot.
Code:
dt = Open("data_table.jmp");
obj = dt << Diagram( Y( :Child ), X( :Parent ) );
Report( obj ) << Save Window Report( "$TEMP/nodt_diagram.jrp", embed data( 0 ) );
Report( obj ) << Close Window;
Open( "$TEMP/nodt_diagram.jrp" );
Code Explanation:
- Open data table;
- Create diagram object.
- Set Y variable.
- Set X variable.
- Save report window.
- Embed data off.
- Close report window.
- Open saved report.
Example 4
Summary: Creates a diagram object with Y-axis variable set to 'Child' and X-axis variable set to 'Parent', utilizing data from an open JMP data table.
Code:
dt under test = Open("data_table.jmp");
obj = Diagram( Y( :Child ), X( :Parent ) );
Code Explanation:
- Open data table;
- Create diagram object.
- Set Y variable to Child.
- Set X variable to Parent.
Diagram using Run Script
Example 1
Summary: Creates and displays a path diagram for SEM analysis, utilizing the Bollen (1989) method.
Code:
dt = Open("data_table.jmp");
obj = dt << Run Script( "SEM: Bollen (1989)" );
obj << Show Path Diagram( 0 );
Code Explanation:
- Open data table.
- Run SEM script.
- Hide path diagram.
Example 2
Summary: Creates and displays a path diagram for structural equation modeling (SEM) analysis, utilizing the SEM: Bollen (1989) script in JMP.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = dt << Run Script( "SEM: Bollen (1989)" );
obj << Show Path Diagram( 0 );
Code Explanation:
- Set default names.
- Open data table.
- Run SEM script.
- Hide path diagram.
Example 3
Summary: Creates and customizes a path diagram for SEM analysis, utilizing the 'Run Script' function to execute the Bollen (1989) algorithm.
Code:
dt = Open("data_table.jmp");
obj = dt << Run Script( "SEM: Bollen (1989)" );
obj << Color Path Diagram( 1 );
Code Explanation:
- Open data table.
- Run SEM script.
- Color path diagram.
Example 4
Summary: Generates a path diagram for SEM Path Analysis with latent groups, allowing users to rotate and lock the diagram, as well as show means and intercepts.
Code:
dt = Open("data_table.jmp");
obj = dt << Run Script( "SEM: Path Analysis w/ Latent" );
rpt = obj << Report();
scrobj = rpt[Node Graph Box( 1 )];
scrobj << Rotate Latent Groups();
scrobj << Copy Diagram();
scrobj << Lock Diagram();
scrobj << "Show Means/Intercepts"();
Code Explanation:
- Open data_table data
- Run SEM Path Analysis script.
- Extract report object.
- Access Node Graph Box.
- Rotate latent groups.
- Copy diagram.
- Lock diagram.
- Show means/intercepts.
Reliability Block Diagram
Summary: Creates a Reliability Block Diagram (RBD) with multiple devices, defining device blocks and connections between them.
Code:
Names Default To Here( 1 );
ndevices = 200;
stra =
"\[//!
//!STANDALONEPLATFORM
//WARNING: DO NOT CHANGE THE FIRST TWO LINES OF THIS FILE.
Reliability Block Diagram(
System Item(
"Basic Computer",
Reliability Block( "Start", Position( 0.036, 5.345 ) ),
Reliability Block( "End", Position( 6.516, 5.345 ) ),]\";
strb = "";
For Each( {i}, 1 :: ndevices,
name = "Generic Component" || Char( i );
strb = strb || "Reliability Block(\!"" || name || "\!",
Position( " ||
Char( i * .01 ) || ", " || Char( i * .01 ) ||
" ),
Configuration( Basic( Exponential( 1 ) ) )
), ";
);
strc = "Block Connections(
{";
strd = "{\!"Start\!", \!"Generic Component1\!"}, ";
For Each( {i}, 2 :: ndevices-1,
strd = strd || "{\!"Generic Component" || Char( i - 1 ) || "\!", \!"Generic Component" ||
Char( i ) || "\!"}, "
);
strd = strd || "{\!"Generic Component"||char(ndevices-1)||"\!", \!"End\!"}";
stre = "}
)
),
Open System Item( \!"Basic Computer\!" )
)";
strtotal = stra || strb || strc || strd || stre;
New Window( "test", <<Type( "Script" ), strtotal );
Code Explanation:
- Initialize device count.
- Define initial RBD structure.
- Loop through each device.
- Append device block details.
- Initialize connections string.
- Start connection from "Start".
- Loop through devices for connections.
- Append connection between devices.
- End connection to "End".
- Combine all parts into final script.
- Create new window with script.