cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
] />

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
SpannerHead
Level VI

Average the first 100 rows and the last 100 rows of a JMP column.

I have a noisy curve where I need to take average of the extremes and compare to the minimum value.  Thought this would work but doesn't.

Col Mean( :Column_Name W[Index( 1, 100 )] ) + Col Mean( :Column_Name[N Rows() - 99 :: N Rows()] ) / 2

Slán



SpannerHead
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Average the first 100 rows and the last 100 rows of a JMP column.

Here is one way of handling the issue

Names Default To Here( 1 );
dt = 
// Open Data Table: Semiconductor Capability.jmp
// → Data Table( "Semiconductor Capability" )
Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
column_name = "NPN1";
Col Mean( If( Row() <= 100, Column( column_name ), . ) ) + Col Mean(
	If( Row() >= N Rows() - 99,
		Column( column_name ),
		.
	)
) / 2;


// I think this is a better formula to calculate the mean of the extremes
Col Mean( If( Row() <= 100 | Row() >= N Rows() - 99, Column( column_name ), . ) );
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Average the first 100 rows and the last 100 rows of a JMP column.

Here is one way of handling the issue

Names Default To Here( 1 );
dt = 
// Open Data Table: Semiconductor Capability.jmp
// → Data Table( "Semiconductor Capability" )
Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
column_name = "NPN1";
Col Mean( If( Row() <= 100, Column( column_name ), . ) ) + Col Mean(
	If( Row() >= N Rows() - 99,
		Column( column_name ),
		.
	)
) / 2;


// I think this is a better formula to calculate the mean of the extremes
Col Mean( If( Row() <= 100 | Row() >= N Rows() - 99, Column( column_name ), . ) );
Jim
MathStatChem
Level VII

Re: Average the first 100 rows and the last 100 rows of a JMP column.

Try this

(Mean( :Z[Index( 1, 100 )] ) + Mean( :Z[Index( N Rows() - 99, N Rows() )] )) / 2
MathStatChem
Level VII

Re: Average the first 100 rows and the last 100 rows of a JMP column.

I used "Z" as the column name.  

Recommended Articles