I have a problem using 'if' in the evaluation of 'set each value'. In the data table (dt_optics) are numeric continuous columns containing counts of a control. Now, I need to check for nonzero counts and store the result in new columns (to later perform logistic regression). The code I am using is:
column_list = dt_optics << get column names;
n_columns =N Col( dt_optics );
For( i =3, i <= n_columns, i++,
column_name =Char(Column Name( i ))|| "_bin";
dt_optics <<New Column( column_name,
set each value(If((Column( dt_optics, column_list[i]))==0,0,1))
In the column I create all values are 1, no matter what the value in the initial column was (I am sure that there are nonzeros in the initial column). Can somebody help me with that?