作者查詢 / otamatone

總覽項目: 發文 | 留言 | 暱稱
作者 otamatone 在 PTT [ Statistics ] 看板的留言(推文), 共7則
限定看板:Statistics
首頁
上一頁
1
下一頁
尾頁
[程式] stata產生隨機變數by group
[ Statistics ]11 留言, 推噓總分: +3
作者: Linethan - 發表於 2014/09/29 14:59(11年前)
1Fotamatone: by的指令是用在每一個group之下重複一樣的command09/30 01:08
2Fotamatone: 所以就變成每一群之下都產生一組random number09/30 01:08
5Fotamatone: 你可以先產生前100筆random number09/30 11:09
6Fotamatone: gen v = rnormal(0,1) in 1/10009/30 11:10
7Fotamatone: 之後的第101筆跟第1筆一樣, 102跟2一樣, ...09/30 11:11
8Fotamatone: replace v = v[_n-100] if missing(v)09/30 11:11
9Fotamatone: 這是我能想到的方法XD 感覺應該有高級一點的做法09/30 11:12
首頁
上一頁
1
下一頁
尾頁