Stata 中的 SAS N 函数

SAS N Function in Stata

Stata 中是否有等同于 SAS N() 函数的函数?

例如,在 SAS 中, N(of a1-a10) 应该计算出 a1a10 的变量数,其中包含非缺失值。

egen 函数 count()rownonmiss() 生成新变量中非缺失值的计数,第一个工作列(例如变量)和第二个工作行-明智的(跨观察中的变量)。

许多命令以各种方式报告缺失,例如codebookinspectmissings (SSC),一次针对一个或多个变量。最后,参见(例如)this forum post. For the others, see help and manual entries as usual, which are also visible over the internet, e.g. the help for codebook

如何找到它:请注意,search missing 会指向 egen(还有许多其他内容,这不容易得到帮助)。