识别包含非整数值的变量中的观察值

Identify observation(s) within a variable containing noninteger values

我正在尝试 运行 一个 statsby 命令,但我一直收到 group_id: factor variables may not contain noninteger values; an error occurred when statsby executed regress 错误。似乎定义组的变量(即`group_id")包含非整数值,这会引起麻烦。

如何识别非整数情况以便处理它们?还是有更全面的方法来解决这个问题?

* Example generated by -dataex-. To install: ssc install dataex
clear
input float test
  1
  2
3.1
  4
  5
end

tab test if test != round(test, 1)

       test |      Freq.     Percent        Cum.
------------+-----------------------------------
        3.1 |          1      100.00      100.00
------------+-----------------------------------
      Total |          1      100.00

其他类似的解决方案可以使用 int()floor()ceil()