Hi Community,
I'm try to create a script that dynamically creates a model with main effects and interactions.
For instance, I might have a subset of effect columns defined by the following:
all_cols = Current Data Table () << Get Column Names(String);
effect_cols = all_cols[3::8];
And then I build a series of models reducing the effect_cols.
Subsequently, I consider interaction terms. However, I'm having trouble building a list of column names or column references for interaction terms.
I've tried something like this:
if(length(effect_cols) > 1,
interaction_effects = {};
for(i = 1, i < length(effect_cols), i++,
for(j=i+1,j<= length(effect_cols), j ++,
inter_tmp = effect_cols[i] || "*" || effect_cols[j];
interaction_effects = insert(interaction_effects,inter_tmp);
)
)
);
and building it into a model with this:
Fit Model(
Y( :"Result"n ),
Effects(
concat(effect_cols,interaction_effects),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Screening" ),
Run( ),
)
However, this consistently gives an error and my other attempts at using parse() and eval() are not working.
Any help is much appreciated.
Thank you