将单元格中的数据内容作为输出的表格

Tables with Data Content in Cells as Output

我有一个数据集,想创建一个 dofile 来创建 tables,同时考虑到我想强调的数据集的某些方面。

我不需要任何汇总统计数据或频率,而是数据内容本身存在于我的 tables 中。

* some example data
input ///
str4 a b str11 reptiles
"234" 234 "alligator"
"2135" 2135 "lizard"
"324" 324 "snake"
"122" 122 "croc"
"23w4" 234 "alligator"
"21w35" 2135 "lizard"
"32w4" 324 "snake"
"1212" 122 "croc"
"234" 234 "all3igator"
"21135" 2135 "li3zard"
"3214" 324 "sn33ake"
"1232" 122 "cr3oc"
"2334" 234 "alli3gator"
"21235" 2135 "li3zard"
"3234" 324 "sna3ke"
"1232" 122 "cr3oc"

end

说我想创建一个table喜欢

table a b if a=="234" & reptile=="all3igator"

我得到的格式正确但没有数据集的实际内容(我得到的是频率)

目标是在我的 do 文件中定义我的 tables。让它 运行 通过并能够在每隔一段时间添加新数据后快速扫描输出以查找任何有趣的数据更改。

看来您只想list数据。

list if a=="234" & reptile=="all3igator"

或者干脆

list b if a=="234" & reptile=="all3igator"

因为您要限制 areptile

和其他人一样,我仍然不清楚这里到底想要什么,这是消极的定义而不是积极的定义。这个例子很清楚,但不是特别有启发性:正如@Brendan Cox 指出的那样,它似乎暗示只使用 list。但是 groups (SSC) 可能会有所帮助,例如

. groups a b reptiles

  +--------------------------------------------+
  |    a      b     reptiles   Freq.   Percent |
  |--------------------------------------------|
  | 1212    122         croc       1      6.25 |
  |  122    122         croc       1      6.25 |
  | 1232    122        cr3oc       2     12.50 |
  | 2113   2135      li3zard       1      6.25 |
  | 2123   2135      li3zard       1      6.25 |
  |--------------------------------------------|
  | 2135   2135       lizard       1      6.25 |
  | 21w3   2135       lizard       1      6.25 |
  | 2334    234   alli3gator       1      6.25 |
  |  234    234   all3igator       1      6.25 |
  |  234    234    alligator       1      6.25 |
  |--------------------------------------------|
  | 23w4    234    alligator       1      6.25 |
  | 3214    324      sn33ake       1      6.25 |
  | 3234    324       sna3ke       1      6.25 |
  |  324    324        snake       1      6.25 |
  | 32w4    324        snake       1      6.25 |
  +--------------------------------------------+