I have a column with elements: 1,2,3,4 how I can make 4 vectors i=1,2,3,4 which is 1 if that row is i, and -1 if it is not i.
example
mode
1
3
1
2
4
1
i1 i2 i3 i4
1 -1 -1 -1
-1 -1 1 -1
1 -1 -1 -1
-1 1 -1 -1
-1 -1 -1 1
1 -1 -1 -1
I hope it is clear, for example first row is 1 so i1 is 1 and others are -1, second row is 3 so i3=1 and others -1 and so on