Cell Plot
Example 1
Summary: Generates a Cell Plot to visualize the relationships and distributions of verbal scores, test-taking percentages, and geographic locations (states) based on the SAT dataset.
Code:
// Cell Plot
// Open data table
dt = Open("data_table.jmp");
// Cell Plot
Cell Plot(
Y(
:"2004 Verbal"n, :"2004 Math"n,
:"2003 Verbal"n, :"2003 Math"n,
:"2002 Verbal"n, :"2002 Math"n,
:"2001 Verbal"n, :"2001 Math"n,
:"1999 Verbal"n, :"1999 Math"n,
:"1994 Verbal"n, :"1994 Math"n,
:"1997 Verbal"n, :"1997 Math"n,
:"1992 Verbal"n, :"1992 Math"n
),
Label( :State )
);
Code Explanation:
- Open data table.
- Create cell plot.
- Set Y variables.
- Include multiple years' data.
- Add verbal and math scores.
- Label rows by state.
- Display cell plot.
Example 2
Summary: Creates a cell plot to visualize and filter data for specific names, utilizing Local Data Filter and Label features in JMP.
Code:
Open("data_table.jmp");
Cell Plot(
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y( :sex, :height, :weight ),
Label( :name ),
Local Data Filter(
Add Filter(
columns( :name ),
Where( :name == {"ALFRED", "ALICE", "AMY", "BARBARA"} ),
Display( :name, Size( 160, 225 ), List Display )
)
)
);
Code Explanation:
- Open data table;
- Create cell plot.
- Scale uniformly.
- Center at zero.
- Set Y variables: sex, height, weight.
- Label by name.
- Add local data filter.
- Filter by specific names.
- Display filtered names.
- Set filter size.
Example 3
Summary: Generates a cell plot to visualize and analyze verbal scores, test-taking percentages, and geographic locations (states) based on the SAT dataset.
Code:
dt = Open("data_table.jmp");
obj = Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :name, :height, :weight ), X( :age ) );
Code Explanation:
- Open data table.
- Create cell plot.
- Set uniform scaling.
- Disable center at zero.
- Assign Y variables.
- Assign X variable.
Example 4
Summary: Vizualizes SAT dataset to analyze verbal scores, test-taking percentages, and geographic locations (states) using a Cell Plot.
Code:
Open("data_table.jmp");
Cell Plot(
Y(
:Name( "2004 Verbal" ), :Name( "2004 Math" ), :Name( "2003 Verbal" ), :Name( "2003 Math" ), :Name( "2002 Verbal" ),
:Name( "2002 Math" ), :Name( "2001 Verbal" ), :Name( "2001 Math" ), :Name( "1999 Verbal" ), :Name( "1999 Math" ),
:Name( "1994 Verbal" ), :Name( "1994 Math" ), :Name( "1997 Verbal" ), :Name( "1997 Math" ), :Name( "1992 Verbal" ),
:Name( "1992 Math" )
),
Label( :State )
);
Code Explanation:
- Open data table.
- Create cell plot.
- Set Y variables.
- Include multiple years' verbal scores.
- Include multiple years' math scores.
- Use State for labels.
- Display cell plot.
Example 5
Summary: Vizualizes verbal scores, test-taking percentages, and geographic locations (states) using a Cell Plot in JMP.
Code:
Open("data_table.jmp");
Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :drug, :hist0, :hist1, :hist3, :hist5 ) );
Code Explanation:
- Open data table;
- Create cell plot.
- Scale uniformly.
- Center at zero.
- Set Y variables: drug, hist0, hist1, hist3, hist5.
Example 6
Summary: Creates a Cell Plot to visualize and analyze verbal scores, test-taking percentages, and geographic locations (states) based on the SAT dataset.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Cell Plot(
Y(
:Name( "2004 Verbal" ), :Name( "2004 Math" ), :Name( "2003 Verbal" ), :Name( "2003 Math" ), :Name( "2002 Verbal" ),
:Name( "2002 Math" ), :Name( "2001 Verbal" ), :Name( "2001 Math" ), :Name( "1999 Verbal" ), :Name( "1999 Math" ),
:Name( "1994 Verbal" ), :Name( "1994 Math" ), :Name( "1997 Verbal" ), :Name( "1997 Math" ), :Name( "1992 Verbal" ),
:Name( "1992 Math" )
)
);
Code Explanation:
- Set default names.
- Open data table;
- Create cell plot object.
- Specify Y variables.
Example 7
Summary: Creates a cell plot to visualize and analyze the relationships between verbal scores, test-taking percentages, and geographic locations (states) in the SAT dataset.
Code:
dt = Open("data_table.jmp");
obj = Cell Plot( Y( :hist0, :hist1, :hist3, :hist5 ), X( :drug ) );
Code Explanation:
- Open data table;
- Create cell plot object.
- Set Y variables: hist0, hist1, hist3, hist5.
- Set X variable: drug.
Example 8
Summary: Vizualizes SAT dataset to analyze verbal scores, test-taking percentages, and geographic locations (states) using a Cell Plot.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Cell Plot( Y( :hist0, :hist1, :hist3, :hist5 ), X( :drug ) );
obj << Arrange Plots( 1 );
Code Explanation:
- Set default names to current.
- Open data table;
- Create cell plot object.
- Assign variables to Y axis.
- Assign "drug" to X axis.
- Arrange plots in single row.
Example 9
Summary: Vizualizes relationships and distributions between verbal scores, test-taking percentages, and geographic locations (states) using a Cell Plot in JMP.
Code:
Open("data_table.jmp");
Cell Plot(
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y( :sex, :height, :weight ),
Label( :name ),
Local Data Filter( Add Filter( columns( :name ), Display( :name, Size( 160, 225 ), List Display ) ) )
);
Code Explanation:
- Open data table;
- Create cell plot.
- Set uniform scale.
- Center at zero.
- Set Y variables.
- Add labels.
- Enable local data filter.
- Add filter for names.
- Display name filter.
- Set filter size.
Example 10
Summary: Vizualizes relationships and distributions between verbal scores, test-taking percentages, and geographic locations (states) using a Cell Plot in JMP.
Code:
dt = Open("data_table.jmp");
obj = Cell Plot( Y( :hist0, :hist1, :hist3, :hist5 ), X( :drug ), Scale Uniformly, Center at zero, Label( :ID ), By( :dep1 ), );
Code Explanation:
- Open data table;
- Create cell plot object.
- Set Y variables.
- Set X variable.
- Scale uniformly.
- Center at zero.
- Label with ID.
- Group by dep1.
- Display cell plot.
Example 11
Summary: Vizualizes SAT dataset to analyze verbal scores, test-taking percentages, and geographic locations (states) using a Cell Plot.
Code:
dt under test = Open("data_table.jmp");
obj = Cell Plot(
Y(
:Name( "2004 Verbal" ), :Name( "2004 Math" ), :Name( "2003 Verbal" ), :Name( "2003 Math" ), :Name( "2002 Verbal" ),
:Name( "2002 Math" ), :Name( "2001 Verbal" ), :Name( "2001 Math" ), :Name( "1999 Verbal" ), :Name( "1999 Math" ),
:Name( "1994 Verbal" ), :Name( "1994 Math" ), :Name( "1997 Verbal" ), :Name( "1997 Math" ), :Name( "1992 Verbal" ),
:Name( "1992 Math" )
),
Label( :State )
);
Code Explanation:
- Open data table.
- Create cell plot object.
- Set Y variables.
- Add state labels.
- Display cell plot.
Example 12
Summary: Creates a Cell Plot to visualize and analyze verbal scores, test-taking percentages, and geographic locations (states) from the SAT dataset.
Code:
dt under test = Open("data_table.jmp");
obj = Cell Plot(
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y( :hist0, :hist1, :hist3, :hist5 ),
X( :dep1 ),
Legend( 1 ),
Arrange Plots( 1 )
);
Code Explanation:
- Open data table;
- Create Cell Plot object.
- Set uniform scaling.
- Do not center at zero.
- Specify Y variables.
- Specify X variable.
- Add legend.
- Arrange plots horizontally.
Example 13
Summary: Generates a Cell Plot to analyze the distribution of verbal scores, test-taking percentages, and geographic locations (states) based on the SAT dataset, utilizing uniform scaling, centering at zero, and local data filtering.
Code:
Open("data_table.jmp");
obj = Cell Plot(
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y( :drug, :hist0, :hist1, :hist3, :hist5 ),
Legend( 1 ),
Local Data Filter( Add Filter( columns( :diff ), Where( :diff >= 0 & :diff <= 3.555348 ) ) )
);
rpt = obj << Report;
expr = rpt << Get Journal;
p = "Where(:diff >= 0 & :diff <= 3.555348)";
ans = Pat Match( expr, p );
Code Explanation:
- Open data table;
- Create Cell Plot object.
- Set uniform scaling.
- Center plot at zero.
- Define Y variables.
- Add legend.
- Apply local data filter.
- Generate report from object.
- Extract journal from report.
- Match pattern in journal.
Example 14
Summary: Generates a cell plot to analyze the distribution of verbal scores, test-taking percentages, and geographic locations (states) based on the SAT dataset, utilizing local data filtering for specific conditions.
Code:
dt = Open("data_table.jmp");
obj = Cell Plot(
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y( :drug, :hist0, :hist1, :hist3, :hist5 ),
Legend( 1 ),
Local Data Filter( Add Filter( columns( :diff ), Where( :diff >= 0 & :diff <= 3.555348 ) ) )
);
rpt = obj << Report;
expr = rpt << Get Journal;
p = "Where(:diff >= 0 & :diff <= 3.555348)";
ans = Pat Match( expr, p );
Code Explanation:
- Open data table;
- Create cell plot object.
- Set scale uniformly.
- Center at zero.
- Define Y variables.
- Add legend.
- Apply local data filter.
- Generate report.
- Extract journal expression.
- Match pattern in expression.
Example 15
Summary: Generates a treemap visualization to analyze the relationships and distributions of verbal scores, test-taking percentages, and geographic locations (states) based on the SAT dataset.
Code:
dt = Open("data_table.jmp");
obj = Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :height ), Legend( 1 ) );
:height << Set Property( "Missing Value Codes", 999 );
:height << Set Values( [999] );
obj2 = obj << Redo Analysis;
rpt = obj2 << Report;
expr = Parse( rpt[CellPlotBox( 1 )] << Get Journal );
actN = Arg( Extract Expr( expr, values( Wild List() ) ), 1 );
Code Explanation:
- Open data table.
- Create cell plot object.
- Set missing value code for height.
- Assign missing value code to height.
- Redo analysis on cell plot.
- Generate report from redo analysis.
- Parse journal from cell plot report.
- Extract expression from parsed journal.
- Identify first argument of expression.
- Assign extracted argument to actN.
Example 16
Summary: Generates a Cell Plot visualization to analyze the relationships and distributions of verbal scores, test-taking percentages, and geographic locations (states) based on the SAT dataset.
Code:
dt = Open("data_table.jmp");
Cell Plot(
SendToByGroup( {Transform Column( "Last[dep1]", Character, Formula( Word( -1, :dep1 ) ) ) == "n"} ),
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y(
Transform Column( "Abs[hist0]", Formula( Abs( :hist0 ) ) ),
Transform Column( "Abs[hist1]", Formula( Abs( :hist1 ) ) ),
Transform Column( "Abs[hist3]", Formula( Abs( :hist3 ) ) ),
Transform Column( "Abs[hist5]", Formula( Abs( :hist5 ) ) )
),
X( Transform Column( "First[drug]", Character, Formula( Word( 1, :drug ) ) ) ),
Label( Transform Column( "1/ID", Formula( 1 / :ID ) ) ),
By( Transform Column( "Last[dep1]", Character, Formula( Word( -1, :dep1 ) ) ) ),
SendToByGroup(
{Transform Column( "Last[dep1]", Character, Formula( Word( -1, :dep1 ) ) ) == "n"},
SendToReport(
Dispatch( {"Cell Plot Last[dep1]=n"}, "Cell Plot Report", FrameBox, {Frame Size( 69, 69 )} ),
Dispatch( {"Cell Plot Last[dep1]=n"}, "Cell Plot Report", FrameBox( 3 ), {Frame Size( 69, 69 )} )
)
),
SendToByGroup(
{Transform Column( "Last[dep1]", Character, Formula( Word( -1, :dep1 ) ) ) == "y"},
SendToReport(
Dispatch( {"Cell Plot Last[dep1]=y"}, "Cell Plot Report", FrameBox, {Frame Size( 69, 69 )} ),
Dispatch( {"Cell Plot Last[dep1]=y"}, "Cell Plot Report", FrameBox( 3 ), {Frame Size( 69, 69 )} )
)
)
);
Code Explanation:
- Open data table.
- Create Cell Plot.
- Filter by "Last[dep1]" == "n".
- Set uniform scale.
- Center at zero.
- Transform "hist0", "hist1", "hist3", "hist5" to absolute values.
- Transform "drug" to first word.
- Transform "ID" to reciprocal.
- Group by "Last[dep1]".
- Adjust report sizes for "n" and "y" groups.
Example 17
Summary: Generates a Cell Plot to visualize and analyze the relationships between verbal scores, test-taking percentages, and geographic locations (states) in the SAT dataset.
Code:
dt = Open("data_table.jmp");
obj = Cell Plot( Y( :hist0, :hist1, :hist3, :hist5 ), X( :drug ), Scale Uniformly, Center at zero, Label( :ID ), By( :dep1 ), );
rpt = obj << report;
rpt = rpt << parent;
Code Explanation:
- Open data table;
- Create Cell Plot object.
- Set Y variables: hist0, hist1, hist3, hist5.
- Set X variable: drug.
- Scale plot uniformly.
- Center plot at zero.
- Label with ID.
- Group by dep1.
- Generate report object.
- Move up in report hierarchy.
Example 18
Summary: Generates a cell plot to visualize the distribution of verbal scores, test-taking percentages, and geographic locations (states) based on the SAT dataset.
Code:
Open("data_table.jmp");
obj = Cell Plot( Y( :drug, :hist0, :hist1, :hist3, :hist5 ) );
Code Explanation:
- Open data table;
- Create cell plot object.
- Set Y variables: drug, hist0, hist1, hist3, hist5.
Example 19
Summary: Creates a dot plot to visualize the relationships and distributions of verbal scores, test-taking percentages, and geographic locations (states) based on the SAT dataset.
Code:
dt = Open("data_table.jmp");
obj = Cell Plot( Y( :drug, :hist0, :hist1, :hist3, :hist5 ), SendToReport( Dispatch( {}, "", CellPlotBox, Graph Type( "Dot Plot" ) ) ) );
Code Explanation:
- Open data table;
- Create cell plot object.
- Set Y variables: drug, hist0, hist1, hist3, hist5.
- Send report dispatch.
- Set graph type to dot plot.
Example 20
Summary: Creates a VLine Plot to visualize and analyze verbal scores, test-taking percentages, and geographic locations (states) from the SAT dataset.
Code:
dt = Open("data_table.jmp");
obj = Cell Plot( Y( :drug, :hist0, :hist1, :hist3, :hist5 ), SendToReport( Dispatch( {}, "", CellPlotBox, Graph Type( "VLine Plot" ) ) ) );
Code Explanation:
- Open data table;
- Create cell plot object.
- Set Y variables: drug, hist0, hist1, hist3, hist5.
- Send report settings.
- Dispatch to CellPlotBox.
- Set graph type to "VLine Plot".
Example 21
Summary: Creates a cell plot to visualize the distribution of verbal scores, test-taking percentages, and geographic locations (states) based on the SAT dataset.
Code:
dt = Open("data_table.jmp");
obj = Cell Plot( Y( :drug, :hist0, :hist1, :hist3, :hist5 ), SendToReport( Dispatch( {}, "", CellPlotBox, Graph Type( "HLine Plot" ) ) ) );
Code Explanation:
- Open data table;
- Create cell plot object.
- Set Y variables: drug, hist0, hist1, hist3, hist5.
- Send report dispatch.
- Set graph type to HLine Plot.
Example 22
Summary: Creates a HBar Plot to visualize and analyze the relationships between verbal scores, test-taking percentages, and geographic locations (states) in the SAT dataset.
Code:
dt = Open("data_table.jmp");
obj = Cell Plot( Y( :drug, :hist0, :hist1, :hist3, :hist5 ), SendToReport( Dispatch( {}, "", CellPlotBox, Graph Type( "HBar Plot" ) ) ) );
Code Explanation:
- Open data table;
- Create Cell Plot object.
- Set Y variables: drug, hist0, hist1, hist3, hist5.
- Send report settings.
- Dispatch to CellPlotBox.
- Set graph type to HBar Plot.
Example 23
Summary: Creates a cell plot to visualize age distribution by sex, with legend and report generation.
Code:
dt = Open("data_table.jmp");
obj = Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :age ), X( :sex ), Legend( 1 ) );
rpt = obj << report;
dt << Select Where( :age == 12 ) << Exclude;
Code Explanation:
- Open data table;
- Create cell plot object.
- Set scale uniformly to 0.
- Center at zero set to 0.
- Assign Y variable as "age".
- Assign X variable as "sex".
- Add legend to plot.
- Generate report from object.
- Select rows where age is 12.
- Exclude selected rows.
Cell Plot using New Column
Summary: Creates a cell plot with uniform scaling and centering, using a formula to combine multiple variables in a new column.
Code:
dt = Open("data_table.jmp");
dt << New Column( "Special Name", char, formula( :sex || " \ " || :name ) );
dt << Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :sex, :height, :weight ), Label( "Special Name" ) );
Code Explanation:
- Open data table.
- Create new column.
- Assign formula to column.
- Generate cell plot.
- Set uniform scaling.
- Center plot at zero.
- Specify Y variables.
- Use special name labels.
Cell Plot using Select Rows
Example 1
Summary: Vizualizes a data table with two cell plots, filtered by height column, in a new JMP window.
Code:
dt = Open("data_table.jmp");
dt << Clear Select << Select Rows( Index( 1, 35 ) ) << Hide;
New Window( "test",
V List Box(
Data Table("data_table") << Cell Plot(
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y( :height ),
Local Data Filter( Close Outline( 1 ), Add Filter( columns( :height ) ) ),
SendToReport( Dispatch( {}, "Cell Plot", OutlineBox, {Close( 1 )} ) )
),
Data Table("data_table") << Cell Plot(
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y( :height ),
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
)
);
Code Explanation:
- Open data table.
- Clear previous selections.
- Select rows 1 to 35.
- Hide selected rows.
- Create new window titled "test".
- Add vertical list box to window.
- Add first cell plot to list box.
- Set cell plot scale uniformly.
- Set cell plot center at zero.
- Set Y axis to height column.
- Add local data filter to cell plot.
- Close outline for local data filter.
- Add filter for height column.
- Add second cell plot to list box.
- Set cell plot scale uniformly.
- Set cell plot center at zero.
- Set Y axis to height column.
- Add local data filter to cell plot.
- Add filter for height column where height >= 68.
Example 2
Summary: Runs data visualization by creating a cell plot from a selected range of rows in a JMP data table, with uniform scaling and centering at zero.
Code:
dt = Open("data_table.jmp");
dt << Clear Select << Select Rows( Index( 1, 35 ) ) << Hide and Exclude;
dt << Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :height ) );
Code Explanation:
- Open data table.
- Clear previous selections.
- Select rows 1 to 35.
- Hide and exclude selected rows.
- Create cell plot.
- Scale uniformly set to 0.
- Center at zero set to 0.
- Set Y variable to height.
Example 3
Summary: Creates multiple data visualizations and clustering expressions in JMP, including cell plots, hierarchical clustering, and variable clustering, with filtering options for specific rows.
Code:
dt = Open("data_table.jmp");
dt << Clear Select << Select Rows( Index( 1, 35 ) ) << Hide;
dt << clear select;
cellplot_df_N = Expr(
dt << Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :height ), Local Data Filter( Add Filter( columns( :height ) ) ) )
);
HierarchicalClustering_df_N = Expr(
dt << Hierarchical Cluster(
Y( :name, :age, :sex, :height, :weight ),
Method( "Ward" ),
Standardize By( "Columns" ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 1 ),
Color Map( "Blue to Gray to Red" ),
Two Way Clustering,
Local Data Filter( Add Filter( columns( :height ) ) )
)
);
VariableClustering_df_N = Expr(
dt << Cluster Variables(
Y( :age, :height, :weight ),
Cluster Summary( 0 ),
Cluster Members( 0 ),
Cluster Components( 0 ),
Local Data Filter( Add Filter( columns( :height ) ) )
)
);
cellplot_df_Y = Expr(
dt << Cell Plot(
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y( :height ),
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
HierarchicalClustering_df_Y = Expr(
dt << Hierarchical Cluster(
Y( :name, :age, :sex, :height, :weight ),
Method( "Ward" ),
Standardize By( "Columns" ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 1 ),
Color Map( "Blue to Gray to Red" ),
Two Way Clustering,
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
VariableClustering_df_Y = Expr(
dt << Cluster Variables(
Y( :age, :height, :weight ),
Cluster Summary( 0 ),
Cluster Members( 0 ),
Cluster Components( 0 ),
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
Code Explanation:
- Open data table.
- Clear previous selections.
- Select first 35 rows.
- Hide selected rows.
- Clear selection again.
- Define cell plot expression.
- Define hierarchical clustering expression.
- Define variable clustering expression.
- Define cell plot expression for height >= 68.
- Define hierarchical clustering expression for height >= 68.
- Define variable clustering expression for height >= 68.
Example 4
Summary: Runs the creation and visualization of hierarchical clustering, variable clustering, and cell plots for a data table, with interactive filtering options.
Code:
dt = Open("data_table.jmp");
dt << Clear Select << Select Rows( Index( 1, 35 ) ) << Hide;
dt << clear select;
cellplot_df_N = Expr(
dt << Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :height ), Local Data Filter( Add Filter( columns( :height ) ) ) )
);
HierarchicalClustering_df_N = Expr(
dt << Hierarchical Cluster(
Y( :name, :age, :sex, :height, :weight ),
Method( "Ward" ),
Standardize By( "Columns" ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 1 ),
Color Map( "Blue to Gray to Red" ),
Two Way Clustering,
Local Data Filter( Add Filter( columns( :height ) ) )
)
);
VariableClustering_df_N = Expr(
dt << Cluster Variables(
Y( :age, :height, :weight ),
Cluster Summary( 0 ),
Cluster Members( 0 ),
Cluster Components( 0 ),
Local Data Filter( Add Filter( columns( :height ) ) )
)
);
cellplot_df_Y = Expr(
dt << Cell Plot(
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y( :height ),
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
HierarchicalClustering_df_Y = Expr(
dt << Hierarchical Cluster(
Y( :name, :age, :sex, :height, :weight ),
Method( "Ward" ),
Standardize By( "Columns" ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 1 ),
Color Map( "Blue to Gray to Red" ),
Two Way Clustering,
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
VariableClustering_df_Y = Expr(
dt << Cluster Variables(
Y( :age, :height, :weight ),
Cluster Summary( 0 ),
Cluster Members( 0 ),
Cluster Components( 0 ),
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
New Window( "test",
V List Box(
Eval( cellplot_df_N ),
Eval( HierarchicalClustering_df_N ),
Eval( VariableClustering_df_N ),
Eval( cellplot_df_Y ),
Eval( HierarchicalClustering_df_Y ),
Eval( VariableClustering_df_Y )
)
);
Code Explanation:
- Open data table.
- Select rows 1 to 35.
- Hide selected rows.
- Clear row selection.
- Define cell plot for all heights.
- Define hierarchical clustering for all variables.
- Define variable clustering for age, height, weight.
- Define cell plot for heights >= 68.
- Define hierarchical clustering for heights >= 68.
- Define variable clustering for heights >= 68.
Example 5
Summary: Creates cell plots, hierarchical clustering, and variable clustering for a data table with filtered rows, utilizing Local Data Filters and Color Maps.
Code:
dt = Open("data_table.jmp");
dt << Clear Select << Select Rows( Index( 1, 35 ) ) << Hide and Exclude;
cellplot_df_N = Expr(
dt << Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :height ), Local Data Filter( Add Filter( columns( :height ) ) ) )
);
HierarchicalClustering_df_N = Expr(
dt << Hierarchical Cluster(
Y( :name, :age, :sex, :height, :weight ),
Method( "Ward" ),
Standardize By( "Columns" ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 1 ),
Color Map( "Blue to Gray to Red" ),
Two Way Clustering,
Local Data Filter( Add Filter( columns( :height ) ) )
)
);
VariableClustering_df_N = Expr(
dt << Cluster Variables(
Y( :age, :height, :weight ),
Cluster Summary( 0 ),
Cluster Members( 0 ),
Cluster Components( 0 ),
Local Data Filter( Add Filter( columns( :height ) ) )
)
);
cellplot_df_Y = Expr(
dt << Cell Plot(
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y( :height ),
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
HierarchicalClustering_df_Y = Expr(
dt << Hierarchical Cluster(
Y( :name, :age, :sex, :height, :weight ),
Method( "Ward" ),
Standardize By( "Columns" ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 1 ),
Color Map( "Blue to Gray to Red" ),
Two Way Clustering,
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
VariableClustering_df_Y = Expr(
dt << Cluster Variables(
Y( :age, :height, :weight ),
Cluster Summary( 0 ),
Cluster Members( 0 ),
Cluster Components( 0 ),
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
Code Explanation:
- Open data table.
- Clear existing selections.
- Select rows 1 to 35.
- Hide and exclude selected rows.
- Define cell plot expression for all data.
- Define hierarchical clustering expression for all data.
- Define variable clustering expression for all data.
- Define cell plot expression for height ‚â• 68.
- Define hierarchical clustering expression for height ‚â• 68.
- Define variable clustering expression for height ‚â• 68.
Example 6
Summary: Creates multiple plots and clustering analyses for a data table, including cell plots, hierarchical clustering, and variable clustering, with interactive filtering options.
Code:
dt = Open("data_table.jmp");
dt << Clear Select << Select Rows( Index( 1, 35 ) ) << Hide and Exclude;
cellplot_df_N = Expr(
dt << Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :height ), Local Data Filter( Add Filter( columns( :height ) ) ) )
);
HierarchicalClustering_df_N = Expr(
dt << Hierarchical Cluster(
Y( :name, :age, :sex, :height, :weight ),
Method( "Ward" ),
Standardize By( "Columns" ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 1 ),
Color Map( "Blue to Gray to Red" ),
Two Way Clustering,
Local Data Filter( Add Filter( columns( :height ) ) )
)
);
VariableClustering_df_N = Expr(
dt << Cluster Variables(
Y( :age, :height, :weight ),
Cluster Summary( 0 ),
Cluster Members( 0 ),
Cluster Components( 0 ),
Local Data Filter( Add Filter( columns( :height ) ) )
)
);
cellplot_df_Y = Expr(
dt << Cell Plot(
Scale Uniformly( 0 ),
Center at zero( 0 ),
Y( :height ),
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
HierarchicalClustering_df_Y = Expr(
dt << Hierarchical Cluster(
Y( :name, :age, :sex, :height, :weight ),
Method( "Ward" ),
Standardize By( "Columns" ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 1 ),
Color Map( "Blue to Gray to Red" ),
Two Way Clustering,
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
VariableClustering_df_Y = Expr(
dt << Cluster Variables(
Y( :age, :height, :weight ),
Cluster Summary( 0 ),
Cluster Members( 0 ),
Cluster Components( 0 ),
Local Data Filter( Add Filter( columns( :height ), Where( :height >= 68 ) ) )
)
);
New Window( "test",
V List Box(
Eval( cellplot_df_N ),
Eval( HierarchicalClustering_df_N ),
Eval( VariableClustering_df_N ),
Eval( cellplot_df_Y ),
Eval( HierarchicalClustering_df_Y ),
Eval( VariableClustering_df_Y )
)
);
Code Explanation:
- Open data table;
- Clear and select rows 1-35.
- Hide and exclude selected rows.
- Define cell plot for all data.
- Define hierarchical clustering for all data.
- Define variable clustering for all data.
- Define cell plot for height ‚â• 68.
- Define hierarchical clustering for height ‚â• 68.
- Define variable clustering for height ‚â• 68.
- Create new window with plots.
Cell Plot using Set Property
Summary: Creates a cell plot to visualize the mean profit by product line and quarter from the Profit by Product dataset, with uniform scaling and centered at zero.
Code:
Open("data_table.jmp");
:height << Set Property( "Missing Value Codes", 999 );
:height << Set Values( [999] );
Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :height ), Legend( 1 ) );
Code Explanation:
- Open data table;
- Set missing value code for height.
- Replace height values with missing code.
- Create cell plot.
- Scale plot uniformly.
- Center plot at zero.
- Set Y variable to height.
- Add legend to plot.
Cell Plot using Set Values
Summary: Runs neural network analysis and report generation for a data table, with missing value coding and validation methods applied.
Code:
dt = Open("data_table.jmp");
:ABRASION << Set Values( [999] );
obj = Neural(
Y( :ABRASION, :MODULUS, :ELONG, :HARDNESS ),
X( :SILICA, :SILANE, :SULFUR ),
Missing Value Coding( 0 ),
Validation Method( Holdback, 0.3333 ),
Fit( NTanH( 3 ), Plot Actual by Predicted( 1 ) )
);
rpt1 = obj << Report;
expr1 = rpt1 << Get Journal;
:ABRASION << Set Property( "Missing Value Codes", 999 );
obj2 = obj << Redo Analysis;
rpt2 = obj2 << Report;
expr2 = obj2 << get Journal;
actN = Equal( expr1, expr2 );
dt = Open("data_table.jmp");
obj = Cell Plot( Scale Uniformly( 0 ), Center at zero( 0 ), Y( :height ), Legend( 1 ) );
:height << Set Property( "Missing Value Codes", 999 );
:height << Set Values( [999] );
obj2 = obj << Redo Analysis;
rpt = obj2 << Report;
expr = Parse( rpt[CellPlotBox( 1 )] << Get Journal );
actN = Arg( Extract Expr( expr, values( Wild List() ) ), 1 );
Code Explanation:
- Open data table;
- Set ABRASION value to 999.
- Run neural network analysis.
- Retrieve report object.
- Get journal from report.
- Set missing value code for ABRASION.
- Redo neural network analysis.
- Retrieve new report object.
- Get new journal from report.
- Compare old and new journals.
Cell Plot using Theme
Summary: Creates a cell plot report from data in a JMP table, utilizing color themes and cert values to visualize drug-related data.
Code:
cert colortheme = {colorTheme( "Blue to Gray to Red" ), colorTheme( "Blue to Gray to Red" )};
cert values 1 = {values( 0.04, 0.2, 0.1, 0.08, 0.02, 0.06, 0.02, 0.02, 0.07, 1.4, 0.48, 0.24, 0.17, 0.57, 0.35, 0.24 ),
values( 0.03, 0.62, 0.31, 0.22, 0.03, 1.05, 0.73, 0.6, 0.07, 0.83, 1.07, 0.8, 0.09, 3.13, 2.06, 1.23 )};
cert values 2 = {values( 0.1, 0.09, 0.13, 0.14, 0.12, 0.11, 0.1, ., 0.07, 0.07, 0.06, 0.07, 0.05, 0.07, 0.06, 0.07 ),
values( 0.1, 0.09, 0.09, 0.08, 0.08, 0.09, 0.09, 0.1, 0.13, 0.1, 0.12, 0.12, 0.06, 0.05, 0.05, 0.05 )};
dt = Open("data_table.jmp");
obj = Cell Plot( Y( :hist0, :hist1, :hist3, :hist5 ), X( :drug ), Scale Uniformly, Center at zero, Label( :ID ), By( :dep1 ), );
rpt = obj << report;
rpt = rpt << parent;
Code Explanation:
- Define color themes.
- Define cert values 1.
- Define cert values 2.
- Open data table.
- Create cell plot object.
- Assign plot to obj variable.
- Generate report from obj.
- Assign report to rpt variable.
- Move up to parent level in report.
- Assign parent report to rpt variable.