Summary
Example 1
Summary: Generates a summary report by grouping data by Wafer ID, Cluster By Layout, and Layout, with frequency set to 'None' and weight set to 'None'.
Code:
// Generate A Lookup Table
Summary(
Group(
:Wafer ID, :Cluster By Layout,
:Layout
),
Freq( "None" ),
Weight( "None" )
);
Code Explanation:
- Generate summary report.
- Group by Wafer ID.
- Group by Cluster By Layout.
- Group by Layout.
- Set frequency to none.
- Set weight to none.
Example 2
Summary: Creates a summary table from a data table, grouping by age and calculating mean height, while also generating a histogram for height. The script adjusts cell height and display width for better visualization.
Code:
dt = Open("data_table.jmp");
sumDt = dt << Summary(
Group( :age ),
Mean( :height ),
Histogram( :height ),
Freq( "None" ),
Weight( "None" ),
Link to original data table( 0 )
);
sumdt << Set Cell Height( 50 );
sumdt:"Histogram(height)"n << Set Display Width( 200 );
Close( dt, nosave );
Code Explanation:
- Open data table;
- Create summary table.
- Group by age.
- Calculate mean height.
- Generate histogram for height.
- Disable frequency calculation.
- Disable weight calculation.
- Unlink from original table.
- Adjust cell height.
- Adjust histogram display width.
- Close original table without saving.
Example 3
Summary: Opens a data table, replaces height values with missing, and summarizes the data by age, calculating mean height, creating a histogram of height, and removing frequency and weight columns. The script also sets cell height and display width for the summary output.
Code:
dt = Open("data_table.jmp");
dt:height[38] = .;
dt:height[39] = .;
dt:height[40] = .;
sumDt = dt << Summary(
Group( :age ),
Mean( :height ),
Histogram( :height ),
Freq( "None" ),
Weight( "None" ),
Link to original data table( 0 )
);
sumdt << Set Cell Height( 50 );
sumdt:"Histogram(height)"n << Set Display Width( 200 );
Code Explanation:
- Open data table.
- Replace height values with missing.
- Summarize data by age.
- Calculate mean height.
- Create histogram of height.
- Remove frequency column.
- Remove weight column.
- Unlink from original data.
- Increase cell height.
- Adjust histogram display width.
Example 4
Summary: Opens a data table, sets specific rows to missing, and generates a summary table with mean height, histogram, and frequency information grouped by age.
Code:
dt = Open("data_table.jmp");
dt:height[38] = .;
dt:height[39] = .;
dt:height[40] = .;
sumDt = dt << Summary(
Group( :age ),
Mean( :height ),
Histogram( :height ),
Freq( "None" ),
Weight( "None" ),
Link to original data table( 0 )
);
sumdt << Set Cell Height( 50 );
sumdt:"Histogram(height)"n << Set Display Width( 200 );
Close( dt, nosave );
Code Explanation:
- Open data table.
- Set height for rows 38-40 to missing.
- Create summary table.
- Group by age.
- Calculate mean height.
- Generate histogram for height.
- Set frequency to none.
- Set weight to none.
- Do not link to original data table.
- Close original data table without saving.
Example 5
Summary: Opens a data table, creates a summary data table with histograms for age, height, and weight, sets frequency and weight to none, and adjusts the display width of the height histogram.
Code:
dt = Open("data_table.jmp");
sumDt = dt << Summary(
Histogram( :age ),
Histogram( :height ),
Histogram( :weight ),
Freq( "None" ),
Weight( "None" ),
Link to original data table( 0 )
);
sumdt << Set Cell Height( 50 );
sumdt:"Histogram(height)"n << Set Display Width( 200 );
Code Explanation:
- Open data table.
- Create summary data table.
- Add age histogram.
- Add height histogram.
- Add weight histogram.
- Set frequency to none.
- Set weight to none.
- Unlink from original table.
- Set cell height.
- Adjust height histogram display width.
Example 6
Summary: Creates a summary table with histograms for age, height, and weight, while disabling frequency count and weighting, and adjusting display settings.
Code:
dt = Open("data_table.jmp");
sumDt = dt << Summary(
Histogram( :age ),
Histogram( :height ),
Histogram( :weight ),
Freq( "None" ),
Weight( "None" ),
Link to original data table( 0 )
);
sumdt << Set Cell Height( 50 );
sumdt:"Histogram(height)"n << Set Display Width( 200 );
Close( dt, nosave );
Code Explanation:
- Open data table;
- Create summary table.
- Add age histogram.
- Add height histogram.
- Add weight histogram.
- Disable frequency count.
- Disable weighting.
- Unlink from original table.
- Set cell height.
- Adjust height histogram width.
- Close original dataset without saving.
Example 7
Summary: Opens a data table and generates a summary of the data by age, displaying frequency counts without weights.
Code:
dt = Open( "$SAMPLE_DATA/data_table.jmp", invisible );
dt << Summary( N, Subgroup( :age ), Freq( "None" ), Weight( "None" ) );
Code Explanation:
- Open data table.
- Summarize data by age.
Example 8
Summary: Runs the creation and renaming of a summary table by age, utilizing the Summary platform in JMP.
Code:
dt = Open("data_table.jmp");
tabname = "Summary of New";
dt2 = dt << Summary( Group( :age ), Sum( :weight ), output table name( tabname ) );
n = dt2 << Get Name;
Close( dt2, nosave );
Close( dt, nosave );
cert v = [., 1, 6, 7, 8, 9, 10, 11, 12, 13, 2, 3, 4, 5];
dt = New Table( "myTest",
Add Rows( 14 ),
New Column( "Col1", Row State, Row State, Set Values( [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] ) ),
New Column( "Col2", Numeric, Continuous, Format( "Best", 12 ), Formula( Col Rank( :Col1 ) ) )
);
v = :Col2 << Get Values;
Close( dt, nosave );
cert m = [3334608000 3 2 5,
3334608000 5 1 2,
3334608000 6 1 1,
3334608000 7 2 9,
3334694400 2 1 2,
3334694400 3 2 6,
3334694400 4 2 1,
3334694400 5 1 4,
3334694400 7 2 10,
3334694400 9 2 1,
3334780800 1 2 1,
3334780800 2 1 2,
3334780800 3 2 9,
3334780800 5 1 3,
3334780800 7 2 12,
3334780800 8 2 1,
3334780800 9 1 1,
3334780800 9 2 1,
3334867200 2 1 3,
3334867200 3 2 9,
3334867200 4 2 2,
3334867200 5 1 3,
3334867200 6 1 1,
3334867200 7 2 10,
3334867200 9 1 1];
Code Explanation:
- Open data table;
- Create summary table by age.
- Rename summary table.
- Close summary table without saving.
- Close original table without saving.
- Define certification vector.
- Create new table "myTest".
- Add rows to new table.
- Add "Col1" with row states.
- Add "Col2" with formula for ranking.
Example 9
Summary: Creates a summary table by grouping data by age and summing weights, utilizing JMP's built-in Summary platform.
Code:
dt = Open("data_table.jmp");
tabname = "Summary of New";
dt2 = dt << Summary( Group( :age ), Sum( :weight ), output table name( tabname ) );
n = dt2 << Get Name;
Code Explanation:
- Open data table.
- Define new table name.
- Create summary table.
- Group by age.
- Sum weights.
- Assign output table name.
- Store summary table reference.
- Retrieve table name.
Example 10
Summary: Runs data summarization and retrieval for a specified player dataset, utilizing JMP's Summary platform to generate mean counts and sort by ascending or descending order.
Code:
dt = Open("data_table.jmp");
dtsum = dt << Summary( Group( :player ), Mean( :count ) );
sum1 = dtsum:player << get values;
Close( dtsum, nosave );
dtsum = dt << Summary( Group( :player ), order( ascending ), Mean( :count ) );
sum2 = dtsum:player << get values;
Close( dtsum, nosave );
cert sum = {"Rick Robey", "Larry Bird"};
dtsum = dt << Summary( Group( :player ), order( descending ), Mean( :count ) );
sum3 = dtsum:player << get values;
Code Explanation:
- Open data table.
- Summarize data by player.
- Retrieve player names from summary.
- Close summary data table without saving.
- Summarize data by player in ascending order.
- Retrieve player names from summary.
- Close summary data table without saving.
- Define certified players list.
- Summarize data by player in descending order.
- Retrieve player names from summary.
Example 11
Summary: Creates a summary table by grouping data by sex and age, naming the output table with a dynamic date variable.
Code:
dt = Open("data_table.jmp");
dateNew = "03-22-2010";
dtsum = dt << Summary( Group( :sex, :age ), Output Table Name( "CTS OTD-P Summary - " || datenew ) );
n = dtsum << get name;
Code Explanation:
- Open data table;
- Define dateNew variable.
- Create summary table.
- Group by sex and age.
- Name output table.
- Assign summary table name to n.
Example 12
Summary: Runs the calculation and extraction of mean counts for each player in a data table, utilizing Summary and Group functions.
Code:
dt = Open("data_table.jmp");
dtsum = dt << Summary( Group( :player ), Mean( :count ) );
sum1 = dtsum:player << get values;
Code Explanation:
- Open data table;
- Create summary table by player.
- Calculate mean of count for each player.
- Extract player values from summary table.
Example 13
Summary: Runs data summarization by grouping 'end time' and calculating the count of unique values, providing an interactive summary of the grouped data.
Code:
dt = Open("data_table.jmp");
summdt = dt << Summary( Group( :end time ), N( :end time ) );
Code Explanation:
- Open data table.
- Summarize data by group.
Example 14
Summary: Runs data summarization and row deletion by grouping and aggregating values, then removing the first row from the summary.
Code:
dt = Open("data_table.jmp");
summDt = dt << Summary( Group( 4 ), N( 4 ) );
summDt << Delete Rows( 1 );
Code Explanation:
- Open data table.
- Summarize data by groups.
- Delete first row from summary.
Example 15
Summary: Creates a summary table by grouping data by age and sex, calculating mean height, and including marginal statistics.
Code:
dt = Open("data_table.jmp");
sumDt = dt << Summary( Group( :age, :sex ), Mean( :height ), Include marginal statistics );
Code Explanation:
- Open data table.
- Create summary table.
- Group by age and sex.
- Calculate mean height.
- Include marginal statistics.
Example 16
Summary: Visualizes and summarizes data by age, generating a matrix of mean height, weight, maximum height, and minimum weight for each group.
Code:
dt2 = Open("data_table.jmp");
certstat4 = [12 8 58.125 99 66 64,
13 7 60.2857142857143 94.7142857142857 65 67,
14 12 64.1666666666667 100.833333333333 69 81,
15 7 64.5714285714286 108.285714285714 67 92,
16 3 64.3333333333333 118.333333333333 68 112,
17 3 66.6666666666667 140.666666666667 70 116];
sumDt4 = dt2 << Summary(
Group( :age ),
Mean( :height, weight ),
Max( :height ),
Min( :weight ),
statistics column name format( "stat of column" ),
output table name( "Height-Weight Chart" )
);
ut_stat4 = sumDt4 << get as matrix;
Close( sumDt4, NoSave );
Close( dt2, NoSave );
certnrow = [1, 1, 1, 2];
dt3 = New Table( "List Check Bug",
Add Rows( 5 ),
New Column( "Column 1", Character, Nominal, Width( 10 ), Set Values( {"b", "c", "d", "a", "a"} ), List Check( {"d", "c", "b", "a"} ) )
);
sumDt5 = dt3 << Summary( Group( :Column 1 ) );
ut_nrow = sumDt5 << get as matrix;
Code Explanation:
- Open data table.
- Define
certstat4matrix. - Summarize data by age.
- Convert summary to matrix.
- Close summary table without saving.
- Close original data table without saving.
- Define
certnrowlist. - Create new table
List Check Bug. - Summarize new table by column.
- Convert summary to matrix.
Example 17
Summary: Runs data summarization and row selection in a JMP data table, utilizing the Summary platform to group by age and calculate means of height.
Code:
dt = Open("data_table.jmp");
dt2 = dt << Summary( Group( :age ), Mean( :height ), );
dt2 << Clear Select;
dt2 << Select Rows( [4] );
r = dt << Get Selected Rows;
certr = [28, 29, 30, 31, 32, 33, 34];
dt2 << Clear Select;
r = dt << Get Selected Rows;
certr = J( 0, 1, . );
Close( dt2, nosave );
dt2 = dt << Summary( Group( :age ), Mean( :height ), Link to original data table( 0 ) );
dt2 << Select Rows( [4] );
r = dt2 << Get Selected Rows;
certr = [4];
r = dt << Get Selected Rows;
certr = J( 0, 1, . );
Code Explanation:
- Open data table.
- Create summary table by age.
- Clear row selection in summary.
- Select row 4 in summary.
- Get selected rows from original.
- Initialize array certr.
- Clear row selection in summary.
- Get selected rows from original again.
- Reset certr array.
- Close summary table without saving.
Example 18
Summary: Creates a summary data table from 'data_table.jmp', grouping by age, calculating percentage of total for height, counting missing values and unique categories in height, and sub-grouping by sex and height.
Code:
dt = Open("data_table.jmp");
sumDt = dt << Summary(
Group( :age ),
Name( "% of Total" )(:height),
N Missing( :height ),
N Categories( :height ),
Subgroup( :sex, :height )
);
Code Explanation:
- Open data table.
- Create summary data table.
- Group by age.
- Calculate % of Total for height.
- Count missing values in height.
- Count unique categories in height.
- Subgroup by sex and height.
Example 19
Summary: Runs data summarization and category counting for variables in a JMP data table, converting the summary to a matrix.
Code:
dt = Open("data_table.jmp");
sumDt = dt << Summary( N Categories( :name, :height, :age, :sex ) );
rowVector = sumDt << Get as matrix;
Code Explanation:
- Open data table.
- Create summary table.
- Count categories for variables.
- Convert summary to matrix.
Example 20
Summary: Creates a summary table by age, counting height categories and grouping by sex, from an open data table.
Code:
dt = Open("data_table.jmp");
sumDt = dt << Summary( Group( :age ), N Categories( :height ), Subgroup( :sex ) );
rowMatrix = sumDt << Get as matrix;
Code Explanation:
- Open data table;
- Create summary table by age.
- Count height categories.
- Group by sex.
- Retrieve summary table as matrix.
Example 21
Summary: Creates a summary table by grouping data based on specified columns, utilizing JMP's built-in Summary platform.
Code:
dt = Open("data_table.jmp");
cols = {:age, :sex};
sumDt = dt << Summary( Group( cols ) );
Code Explanation:
- Open data table.
- Define columns for summary.
- Create summary table by grouping.
Example 22
Summary: Creates a summary data table by grouping and sub-grouping data from a specified data table, utilizing the Group and Subgroup functions.
Code:
dt = Open("data_table.jmp");
grpList = {:region, :state};
subgrpList = {:city};
sumDt = dt << Summary( Group( grpList ), Subgroup( subgrpList ) );
Code Explanation:
- Open data table;
- Define
grpListwith :region, :state. - Define
subgrpListwith :city. - Create summary data table.
- Group by
grpList. - Subgroup by
subgrpList.
Example 23
Summary: Creates a summary table by grouping and sub-grouping data from an open JMP data table.
Code:
dt = Open("data_table.jmp");
grpList = {};
subgrpList = {};
sumDt = dt << Summary( Group( grpList ), Subgroup( subgrpList ) );
Code Explanation:
- Open data table.
- Initialize group list.
- Initialize subgroup list.
- Create summary table.
Example 24
Summary: Creates a summary table by transforming and grouping data from an open JMP data table, while disabling linking to the original table.
Code:
dt = Open("data_table.jmp");
sumDt = dt << Summary( Group( Transform Column( "Log[height]", Formula( Log( :height ) ) ) ), Link to original data table( 0 ) );
Code Explanation:
- Open data table.
- Create summary table.
- Transform height column.
- Apply log formula.
- Group by transformed height.
- Disable linking to original table.
Example 25
Summary: Creates a summary table grouped by the first letter of the 'sex' column, utilizing the
SummaryandGroupfunctions.
Code:
dt1 = Open("data_table.jmp");
dt2 = dt1 << Summary( Group( Transform Column( "FirstLetter", Character, Formula( Word( 1, :sex ) ) ) ) );
Code Explanation:
- Open data table.
- Create summary table.
- Group by first letter of sex.
Example 26
Summary: Creates a summary table from a data table, grouping by age and calculating mean height and weight, maximum height, and minimum weight.
Code:
dt2 = Open("data_table.jmp");
certstat4 = [12 8 58.125 99 66 64,
13 7 60.2857142857143 94.7142857142857 65 67,
14 12 64.1666666666667 100.833333333333 69 81,
15 7 64.5714285714286 108.285714285714 67 92,
16 3 64.3333333333333 118.333333333333 68 112,
17 3 66.6666666666667 140.666666666667 70 116];
sumDt4 = dt2 << Summary(
Group( :age ),
Mean( :height, weight ),
Max( :height ),
Min( :weight ),
statistics column name format( "stat of column" ),
output table name( "Height-Weight Chart" )
);
ut_stat4 = sumDt4 << get as matrix;
Code Explanation:
- Open data table.
- Define
certstat4matrix. - Create summary table.
- Group by age.
- Calculate mean height and weight.
- Find max height.
- Find min weight.
- Set statistics column names.
- Name output table.
- Convert summary table to matrix.
Example 27
Summary: Runs data processing by opening a data table, creating a summary table with grouped means, selecting specific rows, and defining central ranges.
Code:
dt = Open("data_table.jmp");
dt2 = dt << Summary( Group( :age ), Mean( :height ), );
dt2 << Clear Select;
dt2 << Select Rows( [4] );
r = dt << Get Selected Rows;
certr = [28, 29, 30, 31, 32, 33, 34];
dt2 << Clear Select;
r = dt << Get Selected Rows;
certr = J( 0, 1, . );
Code Explanation:
- Open data table.
- Create summary table.
- Clear selection in summary table.
- Select specific row in summary table.
- Get selected rows from original table.
- Define central range.
- Clear selection in summary table again.
- Get selected rows from original table again.
- Define central range as matrix.
Example 28
Summary: Creates a summary table grouped by year from date, extracting year values into a matrix.
Code:
dt3 = Open("data_table.jmp");
dt4 = dt3 << Summary( Group( Transform Column( "Year", Formula( Year( :Date ) ) ) ) );
vals = dt4:year 2 << get as matrix;
Code Explanation:
- Open data table;
- Create summary table.
- Group by year from date.
- Extract year values into matrix.
Example 29
Summary: Runs data summarization and table management by opening a data table, calculating means and frequencies, creating a new empty table, and sorting lists of tables.
Code:
dt2 = Open("data_table.jmp");
sum2 = dt2 << Summary( Group( :age ), Mean( :height ), Mean( :weight ), Freq( "None" ), Weight( "None" ) );
dt3 = New Table( "Test Table" );
oldListDT = {};
For( inc = 1, inc <= N Table(), inc++,
Insert Into( oldListDT, Data Table( inc ) << Get Name )
);
oldListDT = Sort Ascending( oldListDT );
newListDT = Get Data Table List();
newListDT = Sort Ascending( newListDT << Get Name );
Code Explanation:
- Open data table.
- Summarize data by age.
- Create new empty table.
- Initialize empty list.
- Loop through all tables.
- Append table names to list.
- Sort list in ascending order.
- Get current data table list.
- Sort list in ascending order.
Example 30
Summary: Creates a summary table from a data table, grouping by 'Sample', calculating mean and standard deviation of 'Weight', and converting the result to a matrix.
Code:
dt = Open("data_table.jmp");
dtSum = dt << Summary( Group( :Sample ), Mean( :Weight ), Std Dev( :Weight ) );
sumMat = dtSum << get all columns as matrix;
Code Explanation:
- Open data table;
- Create summary table.
- Group by Sample.
- Calculate Weight mean.
- Calculate Weight standard deviation.
- Convert summary table to matrix.
Summary using Column
Summary: Runs the recoding and summarization of data in a JMP data table, replacing missing values and mapping specific column values to new labels.
Code:
dt = Open("data_table.jmp");
Column( dt, "DEROG" ) << Set Selected;
recodeObj = dt << Recode( “Return” );
recodeObj << Change Value( ., "MISSING" );
recodeObj << Change Value( "10", "MORE" );
recodeObj << Change Value( "0", "NONE" );
wrc = Window( "Recode - DEROG" );
wrc[Combo Box( 1 )] << Set( 3 );
If( Host is( "windows" ),
wrc[Button Box( 4 )] << Click(),
wrc[Button Box( 6 )] << Click()
);
sumDT = Data Table("data_table") << Summary( Group( :DEROG ), Freq( "None" ), Weight( "None" ) );
derogVals = sumDT << Get as matrix;
Code Explanation:
- Open data table.
- Select "DEROG" column.
- Initiate recode operation.
- Replace missing values with "MISSING".
- Replace "10" with "MORE".
- Replace "0" with "NONE".
- Access Recode window.
- Set combo box to third option.
- Click OK button based on OS.
- Create summary table grouped by "DEROG".
Summary using Row State
Example 1
Summary: Runs data summarization and row exclusion, generating a summarized table by Process and Causes, while also extracting the number of rows and defining certificate names.
Code:
dt = Open("data_table.jmp");
Row State( 16 ) = Excluded State( 1 );
Row State( 17 ) = Excluded State( 1 );
Row State( 18 ) = Excluded State( 1 );
Row State( 19 ) = Excluded State( 1 );
Row State( 20 ) = Excluded State( 1 );
Row State( 21 ) = Excluded State( 1 );
Row State( 22 ) = Excluded State( 1 );
Row State( 23 ) = Excluded State( 1 );
Row State( 24 ) = Excluded State( 1 );
Row State( 25 ) = Excluded State( 1 );
sumdt = dt << Summary( Group( :Process, :Causes ) );
actvals = Char( :N Rows << Get As Matrix() );
Close( sumdt, No Save );
Close( dt, No Save );
certnames = {sex, Label, Name( "12" ), Name( "13" ), Name( "14" ), Name( "15" ), Name( "16" ), Name( "17" )};
Code Explanation:
- Open table.
- Exclude rows 16-25.
- Summarize data by Process and Causes.
- Extract number of rows.
- Close summary table.
- Close original table.
- Define certificate names.
Example 2
Summary: Process of opening a data table, excluding specific rows, summarizing data by groups, and extracting row counts.
Code:
dt = Open("data_table.jmp");
Row State( 16 ) = Excluded State( 1 );
Row State( 17 ) = Excluded State( 1 );
Row State( 18 ) = Excluded State( 1 );
Row State( 19 ) = Excluded State( 1 );
Row State( 20 ) = Excluded State( 1 );
Row State( 21 ) = Excluded State( 1 );
Row State( 22 ) = Excluded State( 1 );
Row State( 23 ) = Excluded State( 1 );
Row State( 24 ) = Excluded State( 1 );
Row State( 25 ) = Excluded State( 1 );
sumdt = dt << Summary( Group( :Process, :Causes ) );
actvals = Char( :N Rows << Get As Matrix() );
Code Explanation:
- Open data table.
- Exclude specific rows.
- Summarize data by groups.
- Extract row counts.
Summary using Set Property
Summary: Calculates and visualizes mean height by age, utilizing a summary table to group data and extract age values.
Code:
dt = Open("data_table.jmp");
dt:age << Set Property( "Value Ordering", {17, 16, 15, 12, 13, 14} );
dt2 = dt << Summary( Group( :age ), Mean( :height ) );
v = dt2:age << get values;
Code Explanation:
- Open data table.
- Set age value ordering.
- Create summary table.
- Calculate mean height by age.
- Extract age values from summary.
Summary using Select where
Summary: Process of filtering a data table, excluding specific rows, and generating a summary table by soil type.
Code:
dt = Open("data_table.jmp");
dt << Select where( :soil == "compost" );
dt << Exclude( 1 );
dt << Clear select;
sumdt = dt << Summary( Group( :soil ), Output table name( "Soil Types" ) );
exclRows = sumdt << get excluded rows;
Code Explanation:
- Open table.
- Select specific rows.
- Exclude selected rows.
- Clear selection.
- Create summary table.
- Retrieve excluded rows.
Summary using Tabulate
Summary: Creates tabulation reports and summary tables to analyze data by study identifier, outcome, and action taken with treatment, utilizing the Tabulate and Summary functions in JMP.
Code:
dt3 = Open("data_table.jmp");
tabID2 = dt3 << Tabulate(
ID( :Study Identifier ),
Show Control Panel( 0 ),
Add Table(
Column Table( Analysis Columns( :Total Count ) ),
Row Table( Grouping Columns( :Outcome of Adverse Event, :Action Taken with Study Treatment ) )
)
);
Tabulatenew = tabID2 << make into data table;
vals1 = Tabulatenew:Name( "Sum(Total Count)" ) << get as matrix;
tabsum1 = dt3 << Summary(
Group( :Study Identifier, :Outcome of Adverse Event, :Action Taken with Study Treatment ),
Mean( :Total Count ),
Freq( "None" ),
Weight( "None" ),
output table name( "SumNic" )
);
tabsum2 = Data Table("data_table") << Summary(
Group( :Outcome of Adverse Event, :Action Taken with Study Treatment ),
Sum( :"Mean(Total Count)"n ),
Freq( "None" ),
Weight( "None" ),
output table name( "SumNic2" )
);
tabsum2 << select Rows( [1] ) << Delete rows;
vals2 = :Name( "Sum(Mean(Total Count))" ) << get as matrix;
Code Explanation:
- Open data table.
- Create tabulation report.
- Hide control panel.
- Add column table with analysis columns.
- Add row table with grouping columns.
- Convert tabulation to data table.
- Extract sum of total count as matrix.
- Create summary table by study identifier.
- Create second summary table by outcome and action.
- Delete first row from second summary table.
- Extract sum of mean total count as matrix.
Summary using Control Chart
Example 1
Summary: Creates a control chart and calculates expected S values, average, LCL, and UCL from a data table.
Code:
dt = Open("data_table.jmp");
obj = Control Chart( Sample Size( Column( dt, "Sample" ) ), KSigma( 3 ), Chart Col( :Weight, S ), );
rpt = obj << report;
dtX = dt << Summary( Group( :Sample ), Std Dev( :Weight ) );
tmp = dtX << get all columns as matrix;
Close( dtX, no save );
expS = tmp[0, 3];
expAVG = Mean( expS );
expLCL = Max( Mean( expS ) - 3 * Sqrt( 1 - 0.9213 ^ 2 ) * Mean( expS ) / 0.9213, 0 );
expUCL = Mean( expS ) + 3 * Sqrt( 1 - 0.9213 ^ 2 ) * Mean( expS ) / 0.9213;
Code Explanation:
- Open data table.
- Create control chart.
- Extract report object.
- Summarize data by sample.
- Convert summary to matrix.
- Close summary table.
- Retrieve expected S values.
- Calculate expected average.
- Compute expected LCL.
- Compute expected UCL.
Example 2
Summary: Calculates expected S values, average, lower control limit, and upper control limit for a control chart analysis.
Code:
ut relative epsilon = 1e-4;
dt = Open("data_table.jmp");
obj = Control Chart( Sample Size( Column( dt, "Sample" ) ), KSigma( 3 ), Chart Col( :Weight, S ), );
rpt = obj << report;
dtX = dt << Summary( Group( :Sample ), Std Dev( :Weight ) );
tmp = dtX << get all columns as matrix;
Close( dtX, no save );
expS = tmp[0, 3];
expAVG = Mean( expS );
expLCL = Max( Mean( expS ) - 3 * Sqrt( 1 - 0.9213 ^ 2 ) * Mean( expS ) / 0.9213, 0 );
expUCL = Mean( expS ) + 3 * Sqrt( 1 - 0.9213 ^ 2 ) * Mean( expS ) / 0.9213;
Code Explanation:
- Set relative epsilon.
- Open data table.
- Create control chart.
- Get report object.
- Summarize data by group.
- Convert summary to matrix.
- Close summary table.
- Extract expected S values.
- Calculate expected average.
- Calculate expected lower control limit.
- Calculate expected upper control limit.
Example 3
Summary: Creates a control chart from a data table, summarizing data by sample and calculating standard deviation.
Code:
dt = Open("data_table.jmp");
obj = Control Chart( Sample Size( Column( dt, "Sample" ) ), KSigma( 3 ), Chart Col( :Weight, S ), );
rpt = obj << report;
dtX = dt << Summary( Group( :Sample ), Std Dev( :Weight ) );
tmp = dtX << get all columns as matrix;
Code Explanation:
- Open data table;
- Create control chart object.
- Set sample size column.
- Define KSigma level.
- Add weight column to chart.
- Generate control chart report.
- Summarize data by sample.
- Calculate standard deviation.
- Convert summary table to matrix.
- Store matrix in variable.
Example 4
Summary: Calculates and visualizes control charts for a given data table, extracting mean and range values by sample group.
Code:
dt = Open("data_table.jmp");
obj = Control Chart( Sample Size( Column( dt, "Sample" ) ), KSigma( 3 ), Chart Col( :Weight, XBar, R ) );
rpt = obj << report;
dtX = dt << Summary( Group( :Sample ), Mean( :Weight ) );
tmp = dtX << get all columns as matrix;
tmp = tmp[0, 3];
XBarCal = J( N Rows( tmp ), 1, 0 );
For( i = 1, i <= N Rows( tmp ), i++,
XBarCal[i] = tmp[N Rows( tmp ) - i + 1]
);
Close( dtX, no save );
dtR = dt << Summary( Group( :Sample ), Range( :Weight ) );
tmp = dtR << get all columns as matrix;
tmp = tmp[0, 3];
RCal = J( N Rows( tmp ), 1, 0 );
For( i = 1, i <= N Rows( tmp ), i++,
RCal[i] = tmp[N Rows( tmp ) - i + 1]
);
Code Explanation:
- Open data table.
- Create control chart.
- Extract chart report.
- Summarize data by sample.
- Convert summary to matrix.
- Extract mean column.
- Reverse order of means.
- Close summary table.
- Summarize data by sample range.
- Extract range column.
Example 5
Summary: Creates an XBar-R control chart and calculates mean and range statistics for a given dataset, utilizing Control Chart and Summary functions in JMP.
Code:
ut relative epsilon = 1e-3;
dt = Open("data_table.jmp");
obj = Control Chart( Sample Size( Column( dt, "Sample" ) ), KSigma( 3 ), Chart Col( :Weight, XBar, R ) );
rpt = obj << report;
dtX = dt << Summary( Group( :Sample ), Mean( :Weight ) );
tmp = dtX << get all columns as matrix;
tmp = tmp[0, 3];
XBarCal = J( N Rows( tmp ), 1, 0 );
For( i = 1, i <= N Rows( tmp ), i++,
XBarCal[i] = tmp[N Rows( tmp ) - i + 1]
);
Close( dtX, no save );
dtR = dt << Summary( Group( :Sample ), Range( :Weight ) );
tmp = dtR << get all columns as matrix;
tmp = tmp[0, 3];
RCal = J( N Rows( tmp ), 1, 0 );
For( i = 1, i <= N Rows( tmp ), i++,
RCal[i] = tmp[N Rows( tmp ) - i + 1]
);
Code Explanation:
- Set relative epsilon.
- Open data_table data
- Create XBar-R control chart.
- Extract report object.
- Summarize data by sample for Weight.
- Get summary columns as matrix.
- Select mean column.
- Reverse order of means.
- Close summary table without saving.
- Summarize data by sample for range of Weight.
Example 6
Summary: Calculates and visualizes control charts for quality control analysis, utilizing JMP's Control Chart platform to summarize data by sample and generate a report.
Code:
dt = Open("data_table.jmp");
obj = Control Chart( Sample Size( Column( dt, "Sample" ) ), KSigma( 3 ), Chart Col( :Weight, XBar, R ) );
rpt = obj << report;
dtX = dt << Summary( Group( :Sample ), Mean( :Weight ) );
tmp = dtX << get all columns as matrix;
tmp = tmp[0, 3];
XBarCal = J( N Rows( tmp ), 1, 0 );
For( i = 1, i <= N Rows( tmp ), i++,
XBarCal[i] = tmp[N Rows( tmp ) - i + 1]
);
Code Explanation:
- Open data table.
- Create control chart.
- Retrieve report object.
- Summarize data by sample.
- Convert summary to matrix.
- Extract mean column.
- Initialize XBar calculation matrix.
- Loop through mean values.
- Reverse order of means.
- Store reversed means in XBarCal.