本文介绍了如何在Stata中以列表形式获取观察结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Stata 有 r()
宏用于某些命令返回的值(命令后的返回列表
).
Stata has r()
macro for values that some commands return (return list
after the command).
我需要在 list x if y == 1
之后对 x
进行类似的访问,但是 list
只返回 r(N)
,而不是值本身.
I need similar access to x
after list x if y == 1
, but list
returns only r(N)
, not values themselves.
是否可以将观察结果作为局部或全局宏在代码中引用?
Is it possible to get the observations as a local or global macro to refer to it in the code?
推荐答案
尝试 levelsof
命令以获得不同的值.这是猫的睡衣.
Try levelsof
command to get distinct values. It's the cat's pajamas.
这篇关于如何在Stata中以列表形式获取观察结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!