我看到论坛有问类似问题的帖子,也有高手给出的答案用xtmixed
但我们共同的困惑都是这个命令是不是可以用在截面数据中,下面这段表述可以用来回答了:
xtmixed fits linear mixed models. Mixed models are characterized as containing both fixed effects and random effects. The fixed effects are analogous to standard regression
coefficients and are estimated directly. The random effects are not directly estimated but are summarized according to their estimated variances and covariances. Although random
effects are not directly estimated, you can form best linear unbiased predictions (BLUPs) of them (and standard errors) by using predict after xtmixed; see [XT] xtmixed
postestimation. Random effects may take the form of either random intercepts or random coefficients, and the grouping structure of the data may consist of multiple levels of nested
groups. As such, mixed models are also known in the literature as multilevel models and hierarchical linear models. The overall error distribution of the linear mixed model is
assumed to be Gaussian, and heteroskedasticity and correlations within lowest-level groups also may be modeled.