如何根据特定要求指定数据集?

How can I specify a dataset according to a certain requirement?

我想对数据集进行回归。然而,该数据集非常大,包括 1989 年至 2019 年期间公司的数据。从附图中可以看出,每组的最大观察值是 30。 是否可以指定回归命令或数据集以仅使用每组的最大观测数。那么仅适用于 30 年数据始终可用的公司吗?

xtreg tobins_q_w rdi_w ivol_w firm_size_log_w industry_q_w growth_w lev_w adi_w os_w, fe

Outcome xtreg

egen OK = total(!missing(tobins_q_w, rdi_w, ivol_w, firm_size_log_w, industry_q_w, growth_w, lev_w, adi_w, os_)), by(PERMNO) 

然后在 OK == 30.

上有条件地回归