I am trying to pars effects to a fit model in a script.
The effects are generated by a script using several runs of stepwise selection using nominal logistic regression. The selected variable names are outputted to a JMP datafile "final selection.jmp".
This is no problem if only main effects are selected, but I have not been successful in including a two factor interaction.
For main effects only I used the following script:
Basedata=concat( projectpath, "final selection.jmp");
dt = OPEN(basedata);
myparameters = :Parameter << Get Values();
close(dt,nosave);
sdt = Open(concat(projectpath, "all data.jmp"));
UseEffects = {};
For (ii = 1, ii <= NItems(myparameters), ii++,
colname = myparameters[ii];
col = Column(sdt, colname);
InsertInto(UseEffects, col)
);
Fit Model(
Y( :Y ),
Effects( Eval(UseEffects)),
Personality( "Nominal Logistic" ),
Run( Likelihood Ratio Tests( 1 ), Wald Tests( 0 ), Confusion Matrix( 1 ) )
);
Using the same script if an interaction is selected results in an error message "could not find column ..."
I then tried the following script to generate an array with effects:
For (ii = 1, ii <= NItems(myparameters), ii++,
colname = myparameters[ii];
position = contains(colname,"*");
If (position > 0,
col = ":"||left(colname,position)||" :"||right(colname,length(colname)-position),
col = ":"||colname);
/*col = Column(sdt, colname);*/
InsertInto(UseEffects, col)
);
Although the effect names in UseEffects look ok, this also fails and gives again a "Column not found ... " error.
Any solution is welcome.