SAS 创建等间距的箱

SAS create equally spaced bins

我是一个变量和变量的最大值和最小值。如何创建从最小到最大的 10 个等距间隔?我觉得 proc rank 不起作用,因为我想要等距。比如min=1,max=100,那么如果一个数是92,那么它就落入bin 9,如果是72,那么它就落入bin 7。

你想做什么还不完全清楚。根据您 post 编辑的内容,您可以执行以下操作:

1) create new variable = ((old variable - min)/ (max value - min)) * 100
   that creates a variable that is now between 0 and 100

2) bin into 10 bins: int(new variable / 10)  will give you the bin number 

如果这就是您要找的post样本数据集,我可以提供额外的代码。