Skip to content

Instantly share code, notes, and snippets.

@puterleat
Created September 30, 2013 09:38
Show Gist options
  • Save puterleat/6761476 to your computer and use it in GitHub Desktop.
Save puterleat/6761476 to your computer and use it in GitHub Desktop.
. gen STARTEDCRAVING = strength_0 == 0 & (strength_1 > 0 & strength_1 < .)
. gen WASCRAVING = strength_0 == 0
. gen COMPLETE = WASCRAVING if strength_1 >= 0 & strength_1 < .
(632 missing values generated)
.
. tab2 WASCRAVING COMPLETE STARTEDCRAVING
-> tabulation of WASCRAVING by COMPLETE
| COMPLETE
WASCRAVING | 0 1 | Total
-----------+----------------------+----------
0 | 203 0 | 203
1 | 0 400 | 400
-----------+----------------------+----------
Total | 203 400 | 603
-> tabulation of WASCRAVING by STARTEDCRAVING
| STARTEDCRAVING
WASCRAVING | 0 1 | Total
-----------+----------------------+----------
0 | 368 0 | 368
1 | 761 106 | 867
-----------+----------------------+----------
Total | 1,129 106 | 1,235
-> tabulation of COMPLETE by STARTEDCRAVING
| STARTEDCRAVING
COMPLETE | 0 1 | Total
-----------+----------------------+----------
0 | 203 0 | 203
1 | 294 106 | 400
-----------+----------------------+----------
Total | 497 106 | 603
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment