Explore Missing Values
Explore Missing Values using Data Table
Summary: Opens a data table, splits it into series, and creates new table properties for missing value exploration, multivariate analysis, and process screening. It also performs various configurations and visualizations.
Code:
// Split into Series
// Open data table
dt = Open("data_table.jmp");
// Split into Series
split dt =
Data Table("data_table") <<
Split(
Split By( :Series ),
Split( :Price ),
Group( :Date ),
Output Table(
"data_table Split by Series"
),
Remaining Columns( Drop All )
);
split dt <<
NewTableProperty(
"Explore Missing Values",
Explore Missing Values(
Y(
:Apples, :Bananas, :Bread,
:Chicken, :Coffee, :Eggs,
:Electricity, :Fuel oil #2,
:"Gasoline, all"n,
:"Gasoline, unleaded"n,
:Ground chuck, :Lettuce,
:Milk, :Natural Gas,
:Orange juice, :Oranges,
:Tomatoes
),
Missing Value Report,
SendToReport(
Dispatch( {},
"Missing Columns",
OutlineBox,
{SetHorizontal( 1 )}
)
)
)
);
split dt <<
NewTableProperty( "Multivariate",
Multivariate(
Y(
:Apples, :Bananas, :Bread,
:Chicken, :Coffee, :Eggs,
:Electricity
),
Estimation Method( "REML" ),
Matrix Format( "Square" ),
Scatterplot Matrix(
Density Ellipses( 1 ),
Shaded Ellipses( 0 ),
Ellipse Color( 3 )
)
)
);
split dt <<
NewTableProperty( "Process Screening",
Process Screening(
Y(
:Apples, :Bananas, :Bread,
:Chicken, :Coffee, :Eggs,
:Electricity, :Fuel oil #2,
:"Gasoline, all"n,
:"Gasoline, unleaded"n,
:Ground chuck, :Lettuce,
:Milk, :Natural Gas,
:Orange juice, :Oranges,
:Tomatoes
),
Time( :Date ),
Subgroup Sample Size( 3 ),
Recent Shift Up( 1 ),
Recent Shift Down( 1 ),
Shift Graph( 1 )
)
);
Code Explanation:
- Open data table.
- Split data into series.
- Create new table property for missing values.
- Configure missing value exploration.
- Set report orientation.
- Create new table property for multivariate analysis.
- Specify estimation method.
- Format matrix as square.
- Configure scatterplot matrix.
- Create new table property for process screening.
Example 1
Summary: Explores and analyzes missing values in a data table, generating reports and snapshots, and performing clustering and imputation.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Missing Values( Y( :OZONE, :CO, :SO2, :NO, :PM10, :Lead ) );
rpt = obj << report;
boxInd = 1;
actOutline = rpt[Outline Box( boxInd )] << get title;
obj << Missing Value Clustering( 1 );
actOutline = rpt[Outline Box( boxInd + 1 )] << get title;
obj << Missing Value Snapshot( 1 );
actOutline = rpt[Outline Box( boxInd + 2 )] << get title;
obj << close window;
Log Capture(
obj = dt << Explore Missing Values(
Y( :OZONE, :CO, :SO2, :NO, :PM10, :Lead ),
Multivariate Normal Imputation( Shrink Covariances( 1 ) )
)
);
rpt = obj << report;
actOutline = rpt[Outline Box( boxInd )] << get title;
obj << close window;
Code Explanation:
- Open data table.
- Explore missing values.
- Generate report.
- Get first outline box title.
- Perform missing value clustering.
- Get second outline box title.
- Create missing value snapshot.
- Get third outline box title.
- Close explore window.
- Log capture with multivariate normal imputation.
Example 2
Summary: Process of exploring missing values in selected columns, saving imputed values automatically, and performing automated data imputation.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Missing Values( Y( :OZONE, :CO, :SO2, :NO, :PM10 ), Options for Saving Imputed Values( 1 ), Automated Data Imputation );
Close( dt, nosave );
newdt = Current Data Table();
mytitle = newdt << Get Window Title;
Code Explanation:
- Open data table;
- Explore missing values in selected columns.
- Save imputed values automatically.
- Perform automated data imputation.
- Close original table without saving.
- Retrieve current data table.
- Get window title of new table.
Example 3
Summary: Explores missing values in a data table, specifying Y variables and saving imputed values.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Missing Values( Y( 11 :: 15 ), Options for Saving Imputed Values( 3 ) );
Code Explanation:
- Open table.
- Explore missing values.
- Set Y variables.
- Save imputed values.
Example 4
Summary: Process of exploring missing values in a data table, specifying response variables and enabling saving imputed values.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Missing Values( Y( :OZONE, :CO, :SO2, :NO, :PM10 ), Options for Saving Imputed Values( 1 ), Automated Data Imputation );
Code Explanation:
- Open data table.
- Create Explore Missing Values object.
- Set response variables: OZONE, CO, SO2, NO, PM10.
- Enable saving imputed values.
- Perform automated data imputation.
Example 5
Summary: Process of exploring missing values, selecting a column, deleting columns, and logging multivariate normal imputation in JMP.
Code:
dt = Open("data_table.jmp");
emv = dt << Explore Missing Values( Show only columns with missing( 1 ), Y( 1 :: 21 ) );
Column( dt, "J" ) << Set Selected( 1 );
dt << Delete Columns;
Log Capture( emv << Multivariate Normal Imputation );
emv << close window;
Code Explanation:
- Open data table;
- Explore missing values.
- Select column "J".
- Delete selected columns.
- Log multivariate normal imputation.
- Close explore missing values window.
Example 6
Summary: Process of exploring missing values, selecting a column, deleting columns, and logging imputation in JMP.
Code:
dt = Open("data_table.jmp");
emv = dt << Explore Missing Values( Show only columns with missing( 1 ), Y( 1 :: 21 ) );
Column( dt, "J" ) << Set Selected( 1 );
dt << Delete Columns;
Log Capture( emv << Multivariate SVD Imputation );
emv << close window;
Code Explanation:
- Open data table;
- Explore missing values.
- Select column "J".
- Delete selected columns.
- Log capture imputation.
- Close explore window.
Example 7
Summary: Process of exploring missing values, selecting a column, deleting columns, and logging automated imputation in JMP.
Code:
dt = Open("data_table.jmp");
emv = dt << Explore Missing Values( Show only columns with missing( 1 ), Y( 1 :: 21 ) );
Column( dt, "J" ) << Set Selected( 1 );
dt << Delete Columns;
Log Capture( emv << Automated Data Imputation );
emv << close window;
Code Explanation:
- Open data table.
- Explore missing values.
- Select column "J".
- Delete selected columns.
- Log capture automated imputation.
- Close explore window.
Example 8
Summary: Process of exploring missing values, selecting a column, deleting columns, and redoing analysis in JMP.
Code:
dt = Open("data_table.jmp");
emv = dt << Explore Missing Values( Show only columns with missing( 1 ), Y( 1 :: 280 ) );
Column( dt, "P" ) << Set Selected( 1 );
dt << Delete Columns;
emv2 = emv << redo analysis;
emv << close window;
emv2 << close window;
Code Explanation:
- Open data table;
- Explore missing values.
- Select column "P".
- Delete selected columns.
- Redo missing value analysis.
- Close first missing value window.
- Close second missing value window.
Example 9
Summary: Process of exploring missing values, selecting a column, deleting columns, and performing missing value clustering in JMP.
Code:
dt = Open("data_table.jmp");
emv = dt << Explore Missing Values( Show only columns with missing( 1 ), Y( 1 :: 280 ) );
Column( dt, "P" ) << Set Selected( 1 );
dt << Delete Columns;
emv << Missing Value Clustering;
emv << close window;
Code Explanation:
- Open data_table data
- Explore missing values.
- Select column "P".
- Delete selected columns.
- Perform missing value clustering.
- Close explore window.
Example 10
Summary: Process of exploring missing values, selecting a column, deleting columns, and taking a snapshot in JMP.
Code:
dt = Open("data_table.jmp");
emv = dt << Explore Missing Values( Show only columns with missing( 1 ), Y( 1 :: 280 ) );
Column( dt, "P" ) << Set Selected( 1 );
dt << Delete Columns;
emv << Missing Value Snapshot;
emv << close window;
Code Explanation:
- Open data table;
- Explore missing values.
- Select column "P".
- Delete selected columns.
- Take missing value snapshot.
- Close explore window.
Example 11
Summary: Explores data and report generation by opening a data table, exploring missing values, selecting rows, deleting rows, creating a report object, and interacting with button boxes.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Missing Values( Y( :OZONE, :CO, :SO2, :NO, :PM10 ) );
dt << Select Rows( 2 :: (N Row( dt ) - 1) ) << Delete Rows();
rpt = Report( obj );
isPro = 1;
If( isPro,
rpt[Button Box( 8 )] << Click,
rpt[Button Box( 7 )] << Click
);
lc = Collapse Whitespace( Log Capture( rpt[Button Box( 1 )] << Click ) );
lc2 = Collapse Whitespace( Log Capture( obj << close window ) );
Code Explanation:
- Open data table;
- Explore missing values for selected columns.
- Select all rows except first and last.
- Delete selected rows.
- Create report object from exploration.
- Set variable
isProto 1. - Check if
isProis true. - Click button box 8 in report.
- Capture log when clicking button box 1.
- Collapse whitespace in captured logs.
Example 12
Summary: Explores missing values in a data table, generating a report and imputing values based on age groups.
Code:
dt = Open("data_table.jmp");
obj = Explore Missing Values( Y( :height, :weight ), Missing Value Report, By( :age ), Options for Saving Imputed Values( 3 ) );
observedData = {{"LINDA", 17, "F", 62, 116}, {"KIRK", 17, "M", 68, 134}, {"LAWRENCE", 17, "M", 70, 172}};
lc = Collapse Whitespace( Log Capture( obj[6] << Automated Data Imputation ) );
obj << close window;
Code Explanation:
- Open data table;
- Explore missing values.
- Set Y variables: height, weight.
- Generate missing value report.
- Group by age.
- Enable saving imputed values.
- Define observed data.
- Capture log output.
- Automate data imputation.
- Close explore window.
Example 13
Summary: Explores and imputes missing values in a table, grouping by age and utilizing various imputation methods.
Code:
dt = Open("data_table.jmp");
obj = Explore Missing Values( Y( :height, :weight ), Missing Value Report, By( :age ), Options for Saving Imputed Values( 3 ) );
observedData = {{"LINDA", 17, "F", 62, 116}, {"KIRK", 17, "M", 68, 134}, {"LAWRENCE", 17, "M", 70, 172}};
lc2 = Collapse Whitespace( Log Capture( obj[6] << Multivariate RPCA Imputation ) );
lc3 = Collapse Whitespace(
Log Capture( obj[6] << Multivariate SVD Imputation( Number of Singular Vectors( 3 ), Maximum Iterations( 10 ) ) )
);
lc4 = Collapse Whitespace( Log Capture( obj[6] << Multivariate Normal Imputation( Shrink Covariances ) ) );
lc5 = Collapse Whitespace( Log Capture( obj[6] << Multivariate Normal Imputation ) );
obj << close window;
Code Explanation:
- Open table.
- Explore missing values.
- Set Y variables.
- Generate missing value report.
- Group by age.
- Enable saving imputed values.
- Define observed data.
- Perform Multivariate RPCA Imputation.
- Perform Multivariate SVD Imputation.
- Perform Multivariate Normal Imputation with shrinkage.
- Perform Multivariate Normal Imputation.
- Close window.
Example 14
Summary: Explores missing values in a dataset, generating a report for variables OZONE, CO, SO2, NO, PM10, and Lead.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Missing Values( Y( :OZONE, :CO, :SO2, :NO, :PM10, :Lead ), Missing Value Report );
Code Explanation:
- Open data table;
- Assign dataset to variable dt.
- Launch Explore Missing Values.
- Set response variables: OZONE, CO, SO2, NO, PM10, Lead.
- Generate Missing Value Report.
Example 15
Summary: Explores and imputes missing values in a data table, utilizing JMP's Explore Missing Values platform to generate reports.
Code:
dt = Open("data_table.jmp");
x = dt[0, {"OZONE", "CO", "SO2", "NO", "PM10", "Lead"}];
obj = dt << Explore Missing Values( Y( :OZONE, :CO, :SO2, :NO, :PM10, :Lead ), Missing Value Report );
obj << close window;
x2 = dt[0, {"OZONE", "CO", "SO2", "NO", "PM10", "Lead"}];
obj = dt << Explore Missing Values( Y( :OZONE, :CO, :SO2, :NO, :PM10, :Lead ), Missing Value Report );
x2 = dt[0, {"OZONE", "CO", "SO2", "NO", "PM10", "Lead"}];
Log Capture( obj << Multivariate RPCA Imputation );
obj << close window;
Code Explanation:
- Open data table;
- Select variables for analysis.
- Explore missing values for selected variables.
- Close the missing value report window.
- Repeat selecting variables.
- Explore missing values again.
- Repeat selecting variables.
- Log capture of multivariate RPCA imputation.
- Close the imputation report window.
Example 16
Summary: Runs the exploration and reporting of missing values in a data table, specifying response variables OZONE, CO, SO2, NO, PM10, and Lead.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Missing Values( Y( :OZONE, :CO, :SO2, :NO, :PM10, :Lead ) );
rpt = Report( obj );
Code Explanation:
- Open data table;
- Create Explore Missing Values object.
- Set response variables: OZONE, CO, SO2, NO, PM10, Lead.
- Generate report from Explore Missing Values object.
Example 17
Summary: Process of exploring missing values, selecting and deleting middle rows, generating a report, clicking buttons based on a flag, capturing log output, and collapsing whitespace in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Missing Values( Y( :OZONE, :CO, :SO2, :NO, :PM10 ) );
dt << Select Rows( 2 :: (N Row( dt ) - 1) ) << Delete Rows();
rpt = Report( obj );
isPro = 1;
If( isPro,
rpt[Button Box( 8 )] << Click,
rpt[Button Box( 7 )] << Click
);
lc = Collapse Whitespace( Log Capture( rpt[Button Box( 1 )] << Click ) );
Code Explanation:
- Open table.
- Explore missing values.
- Select middle rows.
- Delete selected rows.
- Get report object.
- Set isPro flag.
- Click appropriate button based on flag.
- Capture log output.
- Collapse whitespace in log.
- Store result in lc.
Explore Missing Values using Log Capture
Summary: Explores and imputes missing values in a JMP data table using Multivariate SVD Imputation, with interactive report generation.
Code:
dt = Open("data_table.jmp");
boxInd = 1;
Log Capture(
obj = dt << Explore Missing Values(
Y( :OZONE, :CO, :SO2, :NO, :PM10, :Lead ),
Multivariate SVD Imputation( Number of Singular Vectors( 3 ), Maximum Iterations( 10 ), Show Iteration Log( 1 ), Lambda( 1 ) )
)
);
rpt = obj << report;
actOutline = rpt[Outline Box( boxInd )] << get title;
obj << close window;
Code Explanation:
- Open data table.
- Initialize box index.
- Log capture starts.
- Explore missing values on selected columns.
- Apply multivariate SVD imputation method.
- Set number of singular vectors to 3.
- Set maximum iterations to 10.
- Enable iteration log display.
- Set lambda value to 1.
- Retrieve report from object.
Explore Missing Values using Structural Equation Models
Summary: Creates and launches a Structural Equation Model (SEM) with specified model variables, including Support_L, Goal_L, Work_L, and Interact_L, in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Structural Equation Models( Model Variables( :Support_L, :Goal_L, :Work_L, :Interact_L ) );
obj << Launch Explore Missing Values( 1 );
Code Explanation:
- Open data table;
- Create Structural Equation Model.
- Include Support_L, Goal_L, Work_L, Interact_L.
- Launch Explore Missing Values report.
Explore Missing Values using For
Example 1
Summary: Process of setting random cells to missing in a data table, followed by exploring and imputing missing values using automated data imputation.
Code:
dt = Open("data_table.jmp");
For( j = 1, j <= 3, j++,
rand_row = Random Integer( 1, N Row( dt ) );
rand_col = Random Integer( 1, N Col( dt ) - 1 );
dt[rand_row, rand_col] = .;
);
Log Capture(
emv2 = Explore Missing Values(
Y( :Sepal length, :Sepal width, :Petal length, :Petal width ),
Options for Saving Imputed Values( 2 ),
Automated Data Imputation,
SendToReport( Dispatch( {"Commands"}, "Automated Data Imputation Controls", OutlineBox, {Close( 0 )} ) )
)
);
emv2 << close window;
Code Explanation:
- Open data table;
- Loop 3 times.
- Generate random row index.
- Generate random column index.
- Set selected cell to missing.
- Capture log output.
- Explore missing values.
- Set imputation options.
- Perform automated data imputation.
- Close imputation controls outline.
Example 2
Summary: Explores and filters missing values in a specified data table, utilizing the Explore Missing Values platform to analyze columns with and without missing values.
Code:
dt = Open("data_table.jmp");
For( i = 1, i <= 5, i++,
emv = dt << Explore Missing Values( Y( 1 :: 21 ), Show only columns with missing( 1 ) );
emv << close window;
);
For( i = 1, i <= 5, i++,
emv = dt << Explore Missing Values( Y( 1 :: 21 ), Show only columns with missing( 0 ) );
emv << Show only columns with missing( 1 );
emv << close window;
);
Code Explanation:
- Open data table;
- Loop 5 times.
- Explore missing values for first 21 columns.
- Filter columns with missing values.
- Close the window.
- Repeat steps 3-5.
- Loop 5 times again.
- Explore missing values for first 21 columns.
- Filter columns without missing values.
- Filter columns with missing values.
- Close the window.
Explore Missing Values using As Table
Summary: Process of introducing missing values, joining tables, and exploring missing values in a data table using JMP's scripting language.
Code:
dt = Open("data_table.jmp");
dt2 = As Table( J( N Row( dt ), 100, 23 ) );
nmiss = Floor( .1 * (N Row( dt ) * N Col( dt )) );
For( i = 1, i <= nmiss, i++,
dt[Random Integer( 1, N Row( dt ) ), Random Integer( 1, N Col( dt ) )] = .
);
dt3 = dt << Join( With( dt2 ), By Row Number );
Log Capture(
emv3 = dt3 << Explore Missing Values(
Y( :Y, :Age, :BMI, :BP, :Name( "Total Cholesterol" ), :LDL, :HDL, :TCH, :LTG, :Glucose, 15 :: 114 ),
Options for Saving Imputed Values( 3 ),
Automated Data Imputation,
Set Random Seed( 123 )
)
);
Code Explanation:
- Open data table;
- Create new table dt2 with random data.
- Calculate number of missing values.
- Loop to introduce missing values randomly.
- Join original table with new table.
- Capture log output.
- Explore missing values in joined table.
- Specify columns for analysis.
- Set options for saving imputed values.
- Perform automated data imputation.
Explore Missing Values using Random Index
Example 1
Summary: Process of imputing missing values in a data table, specifically for the 'Region', 'OZONE', 'CO', 'SO2', 'NO', and 'PM10' columns.
Code:
dt = Open("data_table.jmp");
dt[Random Index( N Row( dt ), 10 ), "Region"] = "";
nCols = N Col( dt );
obj = dt << Explore Missing Values(
Y( :Region, :OZONE, :CO, :SO2, :NO, :PM10 ),
Options for Saving Imputed Values( 2 ),
Automated Data Imputation
);
nCols2 = N Col( dt );
extraCols = nCols2 - nCols;
imputedCols = {"Region", "OZONE", "CO", "SO2", "NO", "PM10"};
For( i = 1, i <= 10, i++,
For( j = 1, j <= Length( imputedCols ), j++,
missValInd = Is Missing( dt[0, imputedCols[j]] )
)
);
Code Explanation:
- Open data table.
- Randomly select 10 rows.
- Set Region to missing for selected rows.
- Count initial columns.
- Launch Explore Missing Values.
- Specify Region, OZONE, CO, SO2, NO, PM10 as Y.
- Enable saving imputed values.
- Use Automated Data Imputation.
- Count final columns.
- Calculate number of extra columns added.
Example 2
Summary: Process of exploring missing values in a data table, including automated data imputation and multivariate normal imputation with shrink covariances.
Code:
dt = Open("data_table.jmp");
dt[{38, 39}, "height"] = .;
dt[Random Index( 37, 5 ), "height"] = .;
dt[Random Index( 37, 7 ), "weight"] = .;
obj = Explore Missing Values( Y( :height, :weight ), Missing Value Report, By( :age ), Options for Saving Imputed Values( 3 ) );
observedData = {{"LINDA", 17, "F", ., 116}, {"KIRK", 17, "M", ., 134}, {"LAWRENCE", 17, "M", 70, 172}};
lc = Collapse Whitespace( Log Capture( obj[6] << Automated Data Imputation ) );
Log Capture( obj[6] << Undo Imputation );
lc2 = Collapse Whitespace( Log Capture( obj[6] << Multivariate Normal Imputation( Shrink Covariances ) ) );
Log Capture( obj[6] << Undo Imputation );
lc3 = Collapse Whitespace( Log Capture( obj[6] << Multivariate Normal Imputation ) );
Log Capture( obj[6] << Undo Imputation );
obj << close window;
Code Explanation:
- Open data table.
- Set height missing for rows 38-39.
- Randomly set height missing for 5 rows.
- Randomly set weight missing for 7 rows.
- Explore missing values for height and weight, by age.
- Save imputed values option set to 3.
- Define observed data with missing values.
- Capture log of automated data imputation.
- Undo previous imputation.
- Capture log of multivariate normal imputation with shrink covariances.
- Undo previous imputation.
- Capture log of multivariate normal imputation.
- Undo previous imputation.
- Close explore missing values window.
Explore Missing Values using If
Example 1
Summary: Explores and imputes missing values in a JMP data table, utilizing the Explore Missing Values platform.
Code:
isPro = 1;
If( isPro == 0,
dt = Open("data_table.jmp");
obj = dt << Explore Missing Values( Y( :OZONE, :CO, :SO2, :NO, :PM10, :Lead ), Automated Data Imputation );
nMissing = Sum( Is Missing( dt[0, {"OZONE", "CO", "SO2", "NO", "PM10", "Lead"}] ) );
obj << close window;
Close( dt, nosave );
);
Code Explanation:
- Check if
isProequals 0. - If true, open "data_table.jmp".
- Create missing values exploration object.
- Specify variables for analysis.
- Perform automated data imputation.
- Count missing values.
- Close exploration window.
- Close "data_table.jmp" without saving.
Example 2
Summary: Runs data imputation and exploration processes in JMP, utilizing various methods to handle missing values and log results.
Code:
dt = Open("data_table.jmp");
isPro = 1;
If( isPro,
obj = dt << Explore Missing Values(
Y( :Age, :BMI, :BP, :Name( "Total Cholesterol" ), :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation )
),
obj = dt << Explore Missing Values( Y( :Age, :BMI, :BP, :Name( "Total Cholesterol" ), :LDL, :HDL, :TCH, :LTG, :Glucose ) )
);
If( isPro,
lc1 = Collapse Whitespace( Log Capture( obj << Automated Data Imputation ) )
);
lc2 = Collapse Whitespace( Log Capture( obj << Multivariate RPCA Imputation ) );
lc3 = Collapse Whitespace( Log Capture( obj << Multivariate SVD Imputation( Number of Singular Vectors( 3 ), Maximum Iterations( 10 ) ) ) );
lc4 = Collapse Whitespace( Log Capture( obj << Multivariate Normal Imputation( Shrink Covariances ) ) );
lc5 = Collapse Whitespace( Log Capture( obj << Multivariate Normal Imputation ) );
Code Explanation:
- Open data table;
- Set isPro flag to 1.
- If isPro, explore missing values with validation.
- Otherwise, explore missing values without validation.
- If isPro, log automated data imputation.
- Log multivariate RPCA imputation.
- Log multivariate SVD imputation with settings.
- Log multivariate normal imputation with shrinkage.
- Log multivariate normal imputation.
- Collapse whitespace in logs.
Explore Missing Values using Random Integer
Example 1
Summary: Process of exploring missing values in a data table, including random clearing and setting of entries, range checking, and automated imputation.
Code:
dt = Open("data_table.jmp");
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "sex"] = "";
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "weight"] = .;
Log Capture( Column( dt, "height" ) << Range Check( LELE( 55, 65 ) ) );
p = N Col( dt );
Log Capture(
obj = dt << Explore Missing Values(
Y( :sex, :height, :weight ),
Options for Saving Imputed Values( 1 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
dtList = Get Data Table List();
Remove From( dtList, Loc( dtList, Data Table("data_table") )[1] );
dtNew = dtList[1];
obj << close window;
Close( dtNew, nosave );
Log Capture(
obj = dt << Explore Missing Values(
Y( :sex, :height, :weight ),
Options for Saving Imputed Values( 2 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
obj << close window;
dt << Delete Columns( (p + 1) :: N Col( dt ) );
Log Capture(
obj = dt << Explore Missing Values(
Y( :sex, :height, :weight ),
Options for Saving Imputed Values( 3 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
obj << close window;
Close( dt, nosave );
Random Reset( 123456789 );
Code Explanation:
- Open data table;
- Randomly clear 5 "sex" entries.
- Randomly set 5 "weight" entries to missing.
- Log range check on "height".
- Count columns in dataset.
- Explore missing values with options.
- Capture data table list.
- Remove original dataset from list.
- Select new dataset.
- Close new dataset without saving.
- Repeat explore missing values with different option.
- Close window.
- Delete newly added columns.
- Explore missing values again with final option.
- Close window.
- Close original dataset without saving.
- Reset random seed.
Example 2
Summary: Process of exploring missing values in a data table, imputing values, and deleting columns, while logging range check results for height.
Code:
dt = Open("data_table.jmp");
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "sex"] = "";
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "weight"] = .;
Log Capture( Column( dt, "height" ) << Range Check( LELE( 51, 80 ) ) );
p = N Col( dt );
Log Capture(
obj = dt << Explore Missing Values(
Y( :sex, :height, :weight ),
Options for Saving Imputed Values( 1 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
dtList = Get Data Table List();
Remove From( dtList, Loc( dtList, Data Table("data_table") )[1] );
dtNew = dtList[1];
obj << close window;
Close( dtNew, nosave );
Log Capture(
obj = dt << Explore Missing Values(
Y( :sex, :height, :weight ),
Options for Saving Imputed Values( 2 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
obj << close window;
dt << Delete Columns( (p + 1) :: N Col( dt ) );
Log Capture(
obj = dt << Explore Missing Values(
Y( :sex, :height, :weight ),
Options for Saving Imputed Values( 3 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
obj << close window;
Close( dt, nosave );
Random Reset( 123456789 );
Code Explanation:
- Open data table;
- Randomly set 5 sex entries to missing.
- Randomly set 5 weight entries to missing.
- Log height range check results.
- Count number of columns in dataset.
- Explore missing values for sex, height, weight.
- Save first imputed dataset.
- Remove original dataset from list.
- Select new dataset.
- Close first imputed dataset without saving.
- Explore missing values again, save second imputed dataset.
- Close second imputed dataset without saving.
- Delete newly added columns.
- Explore missing values one last time, save third imputed dataset.
- Close final dataset without saving.
- Reset random seed.
Example 3
Summary: Runs a series of data manipulation and imputation tasks, including introducing missing values, exploring missing values with automated data imputation, and deleting columns.
Code:
dt = Open("data_table.jmp");
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "weight"] = .;
Log Capture( Column( dt, "height" ) << Range Check( LELE( 55, 65 ) ) );
p = N Col( dt );
Log Capture(
obj = dt << Explore Missing Values(
Y( :height, :weight ),
Options for Saving Imputed Values( 1 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
dtList = Get Data Table List();
Remove From( dtList, Loc( dtList, Data Table("data_table") )[1] );
dtNew = dtList[1];
obj << close window;
Close( dtNew, nosave );
Log Capture(
obj = dt << Explore Missing Values(
Y( :height, :weight ),
Options for Saving Imputed Values( 2 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
obj << close window;
dt << Delete Columns( (p + 1) :: N Col( dt ) );
Log Capture(
obj = dt << Explore Missing Values(
Y( :height, :weight ),
Options for Saving Imputed Values( 3 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
obj << close window;
Close( dt, nosave );
Random Reset( 123456789 );
Code Explanation:
- Open data table;
- Introduce missing values in weight column.
- Log height range check results.
- Count number of columns.
- Explore missing values for height and weight.
- Save imputed values option 1.
- Close imputation window.
- Remove original dataset from list.
- Select new dataset.
- Explore missing values again, option 2.
- Close imputation window.
- Delete newly added columns.
- Explore missing values, option 3.
- Close imputation window.
- Close final dataset without saving.
- Reset random seed.
Example 4
Summary: Process of exploring missing values in a data table, performing automated data imputation, and saving imputed values with different options.
Code:
dt = Open("data_table.jmp");
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "weight"] = .;
Log Capture( Column( dt, "height" ) << Range Check( LELE( 51, 69 ) ) );
p = N Col( dt );
Log Capture(
obj = dt << Explore Missing Values(
Y( :height, :weight ),
Options for Saving Imputed Values( 1 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
dtList = Get Data Table List();
Remove From( dtList, Loc( dtList, Data Table("data_table") )[1] );
dtNew = dtList[1];
obj << close window;
Close( dtNew, nosave );
Log Capture(
obj = dt << Explore Missing Values(
Y( :height, :weight ),
Options for Saving Imputed Values( 2 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
obj << close window;
dt << Delete Columns( (p + 1) :: N Col( dt ) );
Log Capture(
obj = dt << Explore Missing Values(
Y( :height, :weight ),
Options for Saving Imputed Values( 3 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
obj << close window;
Code Explanation:
- Open data table.
- Introduce missing values in weight column.
- Log height range check results.
- Count columns in data table.
- Explore missing values for height and weight.
- Save imputed values option 1.
- Set random seed for reproducibility.
- Perform automated data imputation.
- Retrieve list of open data tables.
- Remove original data table from list.
- Assign first remaining table to new variable.
- Close the imputation result window.
- Close the new data table without saving.
- Explore missing values again for height and weight.
- Save imputed values option 2.
- Set random seed for reproducibility.
- Perform automated data imputation.
- Close the imputation result window.
- Delete newly added columns.
- Explore missing values once more for height and weight.
- Save imputed values option 3.
- Set random seed for reproducibility.
- Perform automated data imputation.
- Close the imputation result window.
Example 5
Summary: Process of imputing missing values in a data table, identifying and selecting non-imputed columns, and exploring missing values with specified settings.
Code:
dt = Open("data_table.jmp");
dt[J( 100, 1, Random Integer( 1, N Row( dt ) ) ), "Years at Current Employer"] = .;
dt[J( 100, 1, Random Integer( 1, N Row( dt ) ) ), "Years in Current Position"] = .;
BeforeImputeCols = dt[0, {8, 10}];
missingInd = Loc( Is Missing( BeforeImputeCols ) );
nonMissingInd = Loc( Is Missing( BeforeImputeCols ) == 0 );
NonImputedCols = dt[0, (1 :: 7) || [9] || (11 :: N Col( dt ))];
obj = dt << Explore Missing Values(
By( :Group ),
Y( :"Years at Current Employer"n, :"Years in Current Position"n ),
Set Random Seed( 46897213 ),
Options for Saving Imputed Values( 1 ),
Automated Data Imputation
);
tableList = Get Data Table List();
originalLoc = Contains( tableList, Data Table("data_table") );
Remove From( tableList, originalLoc );
dt2 = tableList[1];
NonImputedColsAfter = dt2[0, (1 :: 7) || [9] || (11 :: N Col( dt ))];
AfterImputeCols = dt2[0, {8, 10}];
obj << close window;
Code Explanation:
- Open data table;
- Replace 100 random "Years at Current Employer" values with missing.
- Replace 100 random "Years in Current Position" values with missing.
- Identify columns 8 and 10 before imputation.
- Find indices of missing values in selected columns.
- Find indices of non-missing values in selected columns.
- Select non-imputed columns.
- Launch Explore Missing Values with specified settings.
- Retrieve list of data tables.
- Remove original table from list.
- Assign first table in list to dt2.
- Select non-imputed columns after imputation.
- Select columns 8 and 10 after imputation.
- Close Explore Missing Values window.
Example 6
Summary: Runs data table operations, including randomizing missing values and logging range check results, to prepare the dataset for further analysis.
Code:
dt = Open("data_table.jmp");
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "sex"] = "";
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "weight"] = .;
Log Capture( Column( dt, "height" ) << Range Check( LELE( 55, 65 ) ) );
p = N Col( dt );
Log Capture(
obj = dt << Explore Missing Values(
Y( :sex, :height, :weight ),
Options for Saving Imputed Values( 1 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
dtList = Get Data Table List();
Remove From( dtList, Loc( dtList, Data Table("data_table") )[1] );
dtNew = dtList[1];
obj << close window;
Code Explanation:
- Open data table;
- Randomly clear 5 sex entries.
- Randomly set 5 weight values to missing.
- Log height range check results.
- Count columns in dataset.
- Log explore missing values results.
- Get list of all data tables.
- Remove data_table from list.
- Assign first table to dtNew.
- Close explore missing values window.
Example 7
Summary: Prepares data and imputation tasks, including randomizing missing values and exploring missing value patterns in a JMP data table.
Code:
dt = Open("data_table.jmp");
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "sex"] = "";
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "weight"] = .;
Log Capture( Column( dt, "height" ) << Range Check( LELE( 51, 80 ) ) );
p = N Col( dt );
Log Capture(
obj = dt << Explore Missing Values(
Y( :sex, :height, :weight ),
Options for Saving Imputed Values( 1 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
dtList = Get Data Table List();
Remove From( dtList, Loc( dtList, Data Table("data_table") )[1] );
dtNew = dtList[1];
obj << close window;
Code Explanation:
- Open data table.
- Randomly clear 5 "sex" entries.
- Randomly set 5 "weight" entries to missing.
- Log capture height range check.
- Count columns in data table.
- Log capture missing value exploration.
- Save imputed values.
- Set random seed for reproducibility.
- Perform automated data imputation.
- Close exploration window.
Example 8
Summary: Runs data table manipulation and exploration, introducing missing values in a column, logging range check results, counting columns, exploring missing values, retrieving a list of data tables, removing a specific table, and closing the explore window.
Code:
dt = Open("data_table.jmp");
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "weight"] = .;
Log Capture( Column( dt, "height" ) << Range Check( LELE( 55, 65 ) ) );
p = N Col( dt );
Log Capture(
obj = dt << Explore Missing Values(
Y( :height, :weight ),
Options for Saving Imputed Values( 1 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
dtList = Get Data Table List();
Remove From( dtList, Loc( dtList, Data Table("data_table") )[1] );
dtNew = dtList[1];
obj << close window;
Code Explanation:
- Open data table;
- Introduce missing values in weight.
- Log height range check results.
- Count columns in dataset.
- Log explore missing values results.
- Get list of all data tables.
- Remove data_table from list.
- Assign second table to dtNew.
- Close explore missing values window.
Example 9
Summary: Runs data table operations, including weight replacement, height range checking, column counting, and missing value exploration.
Code:
dt = Open("data_table.jmp");
dt[J( 5, 1, Random Integer( 1, N Row( dt ) ) ), "weight"] = .;
Log Capture( Column( dt, "height" ) << Range Check( LELE( 51, 69 ) ) );
p = N Col( dt );
Log Capture(
obj = dt << Explore Missing Values(
Y( :height, :weight ),
Options for Saving Imputed Values( 1 ),
Set Random Seed( 123456789 ),
Automated Data Imputation
)
);
dtList = Get Data Table List();
Remove From( dtList, Loc( dtList, Data Table("data_table") )[1] );
dtNew = dtList[1];
obj << close window;
Code Explanation:
- Open data table;
- Replace 5 random weights with missing values.
- Log height range check results.
- Count columns in dataset.
- Log explore missing values results.
- Get all data tables.
- Remove data_table from list.
- Assign first remaining table to dtNew.
- Close explore missing values window.
Explore Missing Values using Collapse Whitespace
Summary: Explores and imputes missing values in a data table, capturing log output and displaying the ADI loading matrix.
Code:
dt = Open("data_table.jmp");
lc = Collapse Whitespace(
Log Capture(
emv = dt << Explore Missing Values(
Y( :Age, :BMI, :BP, :Name( "Total Cholesterol" ), :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Automated Data Imputation
)
)
);
emv << ADI Loading Matrix;
Code Explanation:
- Open data table;
- Collapse whitespace.
- Capture log output.
- Explore missing values.
- Select multiple Y variables.
- Specify validation column.
- Enable automated data imputation.
- Assign explore result to emv.
- Display ADI loading matrix.
Explore Missing Values using Function
Summary: Explores and deletes missing values in a JMP data table, generating reports and capturing logs from button clicks.
Code:
checkSyncWarning = Function( {buttonInd},
{},
dt = Open("data_table.jmp");
obj = dt << Explore Missing Values( Y( :OZONE, :CO, :SO2, :NO, :PM10 ) );
dt << Select Rows( 21 :: N Row( dt ) ) << Delete Rows();
rpt = Report( obj );
Log Capture( rpt[Button Box( 8 )] << Click );
buttonName = rpt[Button Box( buttonInd )] << Get Button Name;
lc = Collapse Whitespace( Log Capture( rpt[Button Box( buttonInd )] << Click ) );
lc2 = Collapse Whitespace( Log Capture( obj << close window ) );
Close( dt, nosave );
);
maxInd = 6;
For( i = 1, i <= maxInd, i++,
checkSyncWarning( i )
);
Code Explanation:
- Define function
checkSyncWarning. - Open data table;
- Explore missing values for specified columns.
- Delete rows 21 to last.
- Generate report from exploration.
- Capture log from first button click.
- Retrieve button name at index
buttonInd. - Capture log from selected button click.
- Capture log from closing window.
- Close dataset without saving.
- Set
maxIndto 6. - Loop through indices 1 to 6.
- Call
checkSyncWarningfor each index.
Explore Missing Values using Random Reset
Summary: Process of randomly selecting rows, clearing specific columns, and exploring missing values in a JMP data table.
Code:
dt = Open("data_table.jmp");
Random Reset( 123456789 );
randRows = Sort Ascending( J( .1 * N Row( dt ), 1, Random Integer( 1, N Row( dt ) ) ) );
randRows2 = Sort Ascending( J( .1 * N Row( dt ), 1, Random Integer( 1, N Row( dt ) ) ) );
randRows3 = Sort Ascending( J( .1 * N Row( dt ), 1, Random Integer( 1, N Row( dt ) ) ) );
dt[randRows, "Sex"] = "";
dt[randRows2, "weight"] = .;
dt[randRows3, "height"] = .;
emv = dt << Explore Missing Values( Y( :sex, :height, :weight ), Options for Saving Imputed Values( 3 ), Set Random Seed( 123456789 ) );
Code Explanation:
- Open data table;
- Reset random seed.
- Generate random row indices.
- Generate second set of random row indices.
- Generate third set of random row indices.
- Clear "Sex" for selected rows.
- Set "Weight" to missing for selected rows.
- Set "Height" to missing for selected rows.
- Explore missing values for specified columns.
- Save imputed values randomly.
Explore Missing Values using Select Rows
Summary: Processes and analyzes missing values in a data table, including subset creation and selection manipulation.
Code:
dt = Open("data_table.jmp");
dt << Select Rows( 1 :: 10 );
dt2 = dt << Subset( Selected Rows( 1 ), All Columns( 1 ) );
dt << Clear Select;
dt << Select Rows( 11 :: N Row( dt ) ) << Hide and Exclude( 1 );
obj = dt << Explore Missing Values( Y( :T, :P, :QRST, :J, :Heart rate ), Missing Value Report );
obj2 = dt2 << Explore Missing Values( Y( :T, :P, :QRST, :J, :Heart rate ), Missing Value Report );
Code Explanation:
- Open data table;
- Select first 10 rows.
- Subset selected rows into new table.
- Clear row selection.
- Select remaining rows.
- Hide and exclude selected rows.
- Explore missing values in original table.
- Explore missing values in subset table.