Hello,
I am wondering how to setup a code that iteratively runs an analysis according to a specific data filter, and then repeat that analysis for a new data filter. The data filter is set to exclude rows based on the presence of a 1 or 0 in a column, and the columns are in sequential order. Here is an example script:
dt = Open("Hyperspectral_DataCleanedOrdered.jmp");
dt << Data Filter(
Mode(Include(1)),
Inverse,
Add Filter(
Columns(Rand001),
Where(:Rand001 >= 0.875 & :Rand001 <= 1)
),
);
doDiscriminant =
Expr(
da = dt << Discriminant(
X( :Site Type ),
Y(
:
:Name( "366" ),
:Name( "367" ),
:Name( "368" ),
:Name( "369" ),
:Name( "370" ),
:Name( "371" ),
:Name( "372" ),
:Name( "373" ),
:Name( "374" ),
:Name( "375" ),
:Name( "376" ),
:Name( "377" ),
:Name( "378" ),
:Name( "379" ),
:Name( "380" ),
:Name( "381" ),
:Name( "382" ),
)
);
for(i=1, i<=10, i++,
doDiscriminant;
da << StepwiseVariableSelection;
for(k=1, k<=i, k++, da << stepForward);
da << applyThisModel;
daRep = da << Report;
daRep["Score Summaries"]<<select;
daRep["Score Summaries"] << Journal("test1");
Current Journal() << Append(text Box("Test1"));
daRep << closeWindow;
);
Current Journal() << Save Journal ("Rand001") [Ideally, this name updates with each iteration]
The discriminant analysis is on loop for a certain amount of stepwise variable selection iterations (10): What I want is for each 1-10 iteration of the discriminant analysis to occur for each iteration of a data filter. The data filter is set to read a column (Rand001, Rand002,...Rand100), and than exclude specific rows based on the content of the column.
Also, I wasn't able to find a simple way to save journals/text files iteratively with a name that updates per-iteration, so that is another piece of useful advice here.
Thank you!