Explore Patterns
Example 1
Summary: Opens a data table and explores patterns for specified variables using the Explore Patterns platform in JMP.
Code:
// Explore Patterns
// Open data table
dt = Open("data_table.jmp");
// Explore Patterns
Explore Patterns(
Y(
:Activated PTT, :ALT, :ALP, :AST,
:Bilirubin, :BUN, :Calcium, :CO2,
:Chloride, :Creatine Kinase,
:Creatinine, :Erythrocytes,
:Glucose, :Hematocrit,
:Hemoglobin, :LDH, :Leukocytes,
:PCO2, :Partial Pressure Oxygen,
:pH, :Phosphate, :Platelet,
:Potassium, :Protein,
:Prothrombin Time, :Sodium,
:Urate
)
);
Code Explanation:
- Open table.
- Explore patterns for variables.
Example 2
Summary: Explores patterns in sensor measurements, generating a report and including missing values.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Patterns( Y( Column Group( "Sensor Measurements" ) ) );
rpt = obj << report;
obj << close window;
obj = dt << Explore Patterns( Y( Column Group( "Sensor Measurements" ) ), Include Missing( 1 ) );
Code Explanation:
- Open data table.
- Launch Explore Patterns.
- Set Y variable group.
- Generate report object.
- Close Explore Patterns window.
- Relaunch Explore Patterns.
- Include missing values option.
- Set Y variable group again.
- Generate report object again.
- Explore Patterns window remains open.
Example 3
Summary: Explores patterns in laboratory results data, grouping by sex and applying various formatting options.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Patterns(
Y( Column Group( "Laboratory Results" ) ),
Minimum Rows for Linear Relationship( 4 ),
Formatted Widths( 1 ),
Leading and Trailing Digits( 1 ),
Fraction Length( 1 ),
Duplicates Across Columns( 1 ),
Linear Relationships( 1 ),
By( :SEX )
);
obj2 = dt << Explore Patterns(
Y( Column Group( "Laboratory Results" ) ),
Minimum Rows for Linear Relationship( 4 ),
Formatted Widths( 1 ),
Leading and Trailing Digits( 1 ),
Fraction Length( 1 ),
Duplicates Across Columns( 1 ),
Linear Relationships( 1 ),
Where( :SEX == "F" )
);
obj3 = dt << Explore Patterns(
Y( Column Group( "Laboratory Results" ) ),
Minimum Rows for Linear Relationship( 4 ),
Formatted Widths( 1 ),
Leading and Trailing Digits( 1 ),
Fraction Length( 1 ),
Duplicates Across Columns( 1 ),
Linear Relationships( 1 ),
Where( :SEX == "M" )
);
Code Explanation:
- Open data table.
- Explore patterns for all groups.
- Set minimum rows for linear relationship.
- Define formatted widths.
- Set leading and trailing digits.
- Define fraction length.
- Allow duplicates across columns.
- Enable linear relationships.
- Group by sex.
- Explore patterns for females.
- Explore patterns for males.
Example 4
Summary: Explores patterns in a data table by specifying Y variables and setting various parameters for run size, duplicates, and linear relationships.
Code:
dt = Open("data_table.jmp");
explore_patterns_obj = dt << Explore Patterns(
Y(
:Activated PTT, :ALT, :ALP, :AST, :Bilirubin, :BUN, :Calcium, :CO2, :Chloride, :Creatine Kinase, :Creatinine, :Erythrocytes,
:Glucose, :Hematocrit, :Hemoglobin, :LDH, :Leukocytes, :PCO2, :Partial Pressure Oxygen, :pH, :Phosphate, :Platelet, :Potassium,
:Protein, :Prothrombin Time, :Sodium, :Urate
),
Minimum Run Size( -1 ),
Minimum Longest Duplicate Size( 0 ),
Minimum Cross Column Duplicate Run Size( 1 ),
Minimum Rows for Linear Relationship( 2 )
);
Code Explanation:
- Open data table.
- Create Explore Patterns object.
- Specify Y variables.
- Set minimum run size.
- Set minimum duplicate size.
- Set cross column duplicate run size.
- Set minimum rows for linear relationship.
Explore Patterns using Collapse Whitespace
Summary: Runs exploratory data analysis by opening a data table, exploring patterns in various combinations of age, weight, height, and sex, and collapsing log whitespace.
Code:
dt = Open("data_table.jmp");
lc = Collapse Whitespace( Log Capture( ep = dt << Explore Patterns( Y( :age ) ) ) );
lc = Collapse Whitespace( Log Capture( ep = dt << Explore Patterns( Y( :age, :weight, :height ) ) ) );
ep << close window;
lc = Collapse Whitespace( Log Capture( ep = dt << Explore Patterns( Y( :age, :sex ) ) ) );
lc = Collapse Whitespace( Log Capture( ep = dt << Explore Patterns( Y( :age, :sex, :weight, :height ) ) ) );
ep << close window;
Code Explanation:
- Open data table;
- Explore Patterns on age.
- Collapse log whitespace.
- Explore Patterns on age, weight, height.
- Collapse log whitespace.
- Close Explore Patterns window.
- Explore Patterns on age, sex.
- Collapse log whitespace.
- Explore Patterns on age, sex, weight, height.
- Collapse log whitespace.