I am having the same issue as Khill, I am trying to run the same contingency analysis for many different year combinations.
Here is the script that I am working on. The script runs well for the first year combination (2006, 2007). Then when I clear the selected rows and try filtering again for the next year combination (2006,2008), the filter doesn't get set, and I get a contingency analysis for all the years of data. I think I am missing something basic.
Please help, I am new to JMP and scripting, but I am enjoying the puzzle.
dt = Open("D:\T_drive\M03-SISP2-Mon\2010-SISP2-GridMon\ZPP\S_sox_0607080910_Merge.jmp")
<< Data Filter(
Location( {849, 180} ),
Add Filter( columns( :Year_ ), Where( :Year_ == {2006, 2007} ) ),
Mode( Include( 1 ) )
);
Contingency(
Y( :LT5m ),
X( :Year_ ),
Contingency Table(
Count( 1 ),
Total %( 1 ),
Col %( 1 ),
Row %( 1 ),
Expected( 0 ),
Deviation( 0 ),
Cell Chi Square( 0 ),
Col Cum( 0 ),
Col Cum %( 0 ),
Row Cum( 0 ),
Row Cum %( 0 )
)
);
dt <
Current Data Table() << Data Filter(
Location( {849, 180} ),
Add Filter( columns( :Year_ ), Where( :Year_ == {2006, 2008} ) ),
Mode( Include( 1 ) )
);
Contingency(
Y( :LT5m ),
X( :Year_ ),
Contingency Table(
Count( 1 ),
Total %( 1 ),
Col %( 1 ),
Row %( 1 ),
Expected( 0 ),
Deviation( 0 ),
Cell Chi Square( 0 ),
Col Cum( 0 ),
Col Cum %( 0 ),
Row Cum( 0 ),
Row Cum %( 0 )
)
);
dt <
Current Data Table() << Data Filter(
Location( {849, 180} ),
Add Filter( columns( :Year_ ), Where( :Year_ == {2006, 2009} ) ),
Mode( Include( 1 ) )
);
Contingency(
Y( :LT5m ),
X( :Year_ ),
Contingency Table(
Count( 1 ),
Total %( 1 ),
Col %( 1 ),
Row %( 1 ),
Expected( 0 ),
Deviation( 0 ),
Cell Chi Square( 0 ),
Col Cum( 0 ),
Col Cum %( 0 ),
Row Cum( 0 ),
Row Cum %( 0 )
)
);