Hi,
I have a table as follows where score has a value from 0 to 4, and corresponding to each value of the score I have a column for risk.
ID Score Risk0 Risk1 Risk2 Risk3 Risk4
12 0 0.1 0.5 0.6 0.2 0.12
15 3 0.4 0.6 0.7 0.1 0.39
10 1 0.2 0.3 0.4 0.5 0.67
I want to have a new variable like Risk where its value depends on Score. For example for observation with ID=12, since Score=0, I want to have Risk=Risk0=0.1, similarly for ID=10, Risk should be Risk=Risk1=0.3.
Thanks!