|
cb5a.do:14 |
[6] | [+] lcb5a | ||
|
cb5a.do:14 |
[22] | [+] lcb5a | ||
|
cb5a.do:14 |
[28] | cb5along.dta | ||
| master.do:3 | ||||
| → | cb5a.do | ↘ | ||
|
cb5along.dta |
[14] |
cb5a.do:6 cb5a.do:22 cb5a.do:28 |
||
cb5a.do open
file:script:do
| # | content |
|---|---|
| 1 [+] | * cb5A |
| 3 [+] | * could do with collapse but if we want the count * appended to the current dataset... |
| 6 [+] | use cb5a , |
| 7 [+] | list |
| 9 [+] | * generate rowid = state + string(year) |
| 11 [+] | egen rowid = concat(state year) |
| 12 [+] | reshape long cand , |
| 13 [+] | list |
| 14 [+] | save cb5along , |
| 16 [+] | bysort state cand: generate byte last=(_n == _N) |
| 17 [+] | egen totcand = total(last) , |
| 18 [+] | drop last |
| 19 [+] | quietly reshape wide |
| 20 [+] | list , |
| 22 [+] | use cb5a , |
| 23 [+] | generate rowid = state + string(year) |
| 24 [+] | reshape long cand , |
| 25 [+] | bysort state cand: generate byte last=(_n == _N) |
| 26 [+] | tabstat last , |
| 28 [+] | use cb5along , |
| 29 [+] | egen indivcount = tag(state cand) |
| 30 [+] | egen totcand = total(indivcount) , |
| 31 [+] | tabstat totcand , |
* cb5A * could do with collapse but if we want the count * appended to the current dataset... use cb5a, clear list * generate rowid = state + string(year) egen rowid = concat(state year) reshape long cand, i(rowid) j(candnr) list save cb5along, replace bysort state cand: generate byte last=(_n == _N) egen totcand = total(last), by(state) drop last quietly reshape wide list, sepby(state) use cb5a, clear generate rowid = state + string(year) reshape long cand, i(rowid) j(candnr) bysort state cand: generate byte last=(_n == _N) tabstat last, stat(sum) nototal by(state) use cb5along, clear egen indivcount = tag(state cand) egen totcand = total(indivcount), by(state) tabstat totcand, nototal by(state)