Dear @XiangCD_MP_User , I had several issues with your script. If I got your task, it is doing a oneway analysis for each continuous column of the data table by :site, and saving the data table with the mean.
If so, I would do it like follows:
Alternatively there are other possiblities, e.g. putting all together in one "Fit Group" statement. The best way depends on your scripting skills, and what exact environment it should run in.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
// dt = Data Table ("Analysis");
OW_lst = {};
ColNamesList = dt << get column names( string, "Continuous" );
// When using single report windows, you would need to collect the result table from each of them
/*
For( i = N Items( ColNamesList ), i >= 1, i--,
Insert Into( OW_lst, dt << Oneway( Y( Column( ColNamesList[i] ) ), X( :sex ), Means( 1 ), Automatic Recalc( 0 ) ) )
);
*/
// Generate new report window to collect all analyses
nw = New Window( "Oneway Collection",
hlb = H List Box(
For( i = N Items( ColNamesList ), i >= 1, i--,
// collect references to each analysis in OW_lst
Insert Into( OW_lst, dt << Oneway( Y( Column( ColNamesList[i] ) ), X( :sex ), Means( 1 ), Automatic Recalc( 0 ) ) )
)
)
);
// Message will collect all similar tables in one data table
dtCombined = Report( OW_lst[1] )[Table Box( 1 )] << Make Combined Data Table;
// Alternatively you would be able to get the same result w/o working with a list like follows
//(nw << XPATH( "//TableBox" ))[2] << Make Combined Data Table;
Georg