Hi, I need to create a Categorical variable which takes value based on the distribution of another one. My variable newproxy1_t range from 0 to 1. I would like to create a categorical variable equal 0 if newproxy1_t is 0, 1 for the value below the 0.6 quantile (except if newproxy1_t==0) and 2 if the values of newproxy1_t are above 0.6 quantile. I need help with the command.
Thanks for the help.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float newproxy1_t .002398492 .000760572 .0009255342 .0043989443 .0009469199 .013322884 .0004572822 .8344262 .020992367 .012115093 .012616316 .02273702 .012616316 .00041731 .29005027 .22095495 .0001596679 .0007194245 .00065185 .0004572822 .5969549 .00022686025 .0008383903 .009343715 .0010445962 .004448524 .0001596679 .0011673005 .0011495574 .001015916 .3489583 .5289608 .0008383903 .0032484184 .0001596679 .00011327594 .0032484184 .0011673005 .0011740534 .017035775 .0004572822 .0042737895 .0011793916 .6494555 .005045526 .07719298 .000760572 .005729085 .03750375 .009343715 .024712645 .0032484184 .016735602 .00011327594 .0014688977 .0014688977 .0004572822 .01017355 .0190163 .001015916 .01124157 .0042737895 .00041731 .0011673005 .0996013 .013322884 .00777172 .006516427 .0011673005 .00011327594 .8555676 .001973944 .0024109297 .00967118 .013322884 .00967118 .1122975 .0043989443 .000961756 .0011495574 .27229196 .007041927 .007041927 .0009313878 .00065185 .0009469199 .005789594 .008631085 .4254324 .0011673005 .00065185 .6715117 .03981855 .5496749 .0043989443 .019243853 .007041927 .004532125 .005718954 .5991238 end
Thanks for the help.
Comment