cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
MichaelO
Level II

How to Use a list of Columns as Analysis Columns in Tabulate?

I'm having an issue where I want to tabulate the sum and n for each test in a large testprogram. I'm not sure what my issue is, but would appreciate some guidance. The code compiles and outputs the Tabulate window as seen below, but isn't populated.

MichaelO_0-1658436074336.png

 

Below is the code I have written:

 

dt = Current Data Table();
colList = dt << Get Column Names( string );
colname = Column(dt, "TEST_T") << getname;
testIndex = (Loc(colList, colname))[1];
numRows = N Rows(dt);

For(i = (testIndex + 1), i <= N Items(colList), i++,
	column = Column(dt, colList[i]);
	For(j = 1, j <= numRows, j++,
		column[j] = Substitute(column[j], 
			"Pass", "1",
			"Fail", "0"
		);		
	);
);

//Change Modeling Type for Tabulate functionality
dt:tst_temp << Set Modeling Type(Nominal);
dt:SITE_NUM << Set Modeling Type(Nominal);

////Change Every Column after TEST_T to Numeric Data Type and Continuous Modeling type
For(i = (testIndex + 1), i <= N Items(colList), i++,
	column = Column(dt, colList[i]);
	column << Data Type(Numeric);
	column << Set Modeling Type(Continuous);
);

list = dt << Get Column Names( string );
Remove From(list, 1, testIndex);

yieldByTest = (dt << Tabulate(
		Add Table(
			Column Table(
				Grouping Columns(:tst_temp),
				Statisitcs(Sum, N)
			),
			Row Table(
				Analysis Columns(Column(Eval(list)))
			)
		),invisible
	)
) << Make Into data Table;
yieldByTest << Set Name("Yield by Test Across Temperature");

 

1 ACCEPTED SOLUTION

Accepted Solutions
Georg
Level VII

Re: How to Use a list of Columns as Analysis Columns in Tabulate?

I think this works as an example, 

in your script you have a typo "Statisics(Sum, N)"

 

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// Get a list of all continuous Columns
colList = dt << Get Column Names( "Continuous" );

// Feed that list to Analysis Columns of Tabulate
dt << Tabulate(
	Show Control Panel( 0 ),
	Add Table( Column Table( Analysis Columns( Eval( colList ) ), Statistics( Mean, N ) ), Row Table( Grouping Columns( :sex ) ) )
);

 

 

Georg

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: How to Use a list of Columns as Analysis Columns in Tabulate?

Please provide a sample of what your expected output is.

Jim
Georg
Level VII

Re: How to Use a list of Columns as Analysis Columns in Tabulate?

I think this works as an example, 

in your script you have a typo "Statisics(Sum, N)"

 

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// Get a list of all continuous Columns
colList = dt << Get Column Names( "Continuous" );

// Feed that list to Analysis Columns of Tabulate
dt << Tabulate(
	Show Control Panel( 0 ),
	Add Table( Column Table( Analysis Columns( Eval( colList ) ), Statistics( Mean, N ) ), Row Table( Grouping Columns( :sex ) ) )
);

 

 

Georg
MichaelO
Level II

Re: How to Use a list of Columns as Analysis Columns in Tabulate?

That is really disappointing - I just need to practice my spelling I guess!

MichaelO
Level II

Re: How to Use a list of Columns as Analysis Columns in Tabulate?

Here is an example output from the Tabulate window. In practice the number of rows will be much larger. Follow up question, is there a way to get the Sum/N into a column for each temperature from the Tabulate window? I've been manually doing it, but was wondering if there is a simple way to do this from the Tabulate window?

MichaelO_0-1658440945763.png