Displaying 1 result from an estimated 1 matches for "3x100".
Did you mean:
x100
2006 Aug 31
6
newbie question about index
Hi,
I am trying to convert a variable a = sample(1:3,100,rep = T) represents choices into a 3X100 dummy varible b with corresponding element set to 1 otherwise 0.
eg.
a: 1 3 2 1 2 3 1 1....
b: 1 0 0 1 0 0 1 1..
0 0 1 0 1 0 0 0...
0 1 0 0 0 1 0 0...
Is there something like b[a] =1 existing? I could not figure this out myself.
---------------------------------
Mp3·è¿ñËÑ-иèÈȸè...