Thanks a lot for your help, and I have managed to write an ado file that
seems to work fine till I found out that it won't work with a varlist of
more than 8. I have attached our previous Q&A emails.
Several Notes:
`imax': a macro that I have grabbed using 2^`nvars'-1, where `nvars' is a
macor containing number of variables in the varlist.
part of the ado file that's relevant to my question
************************************************************************
......
......
......
quietly gen `pat02'=.
format `pat02' %0`nvars'.0f
Here one function of this ado file is to go through all combinations of
variables in the varlist and to calculate the listwise nonmissing sample
size. For example if the syntax is:
It will produce the listwise nonmissing sample size for var3 var6 (so a "0"
within patmis options indicates exclusion from the listwise nonmissing
sample size calculation, and a "1" indicates inclusion.
And it will also calculate all listwise nonmissing sample size for any
combinations (choose 1 to 6 out of 6 = 2^6 combinations, except the
possibility of choosing none) of variables among these six variables
(var1-var6). Results as follow, and the only difference is that I used 9
variables. I only grab the portion that starts to pose problems:
***************************************************
......
......
......
011101110 | 1387
011101111 | 1387
011110000 | 1192
011110001 | 1192
011110010 | 1192
011110011 | 1192
011110100 | 1192
011110101 | 1192
011110110 | 1192
011110111 | 1192
011111000 | 1191
011111001 | 1191
011111010 | 1191
011111011 | 1191
011111100 | 1191
011111101 | 1191
011111110 | 1191
011111111 | 1191
100000000 | 1388
100000008 | 1388
100000096 | 1388
100000104 | 1388
100000112 | 1388
100001000 | 1387
100001008 | 1387
100001104 | 1387
100001112 | 1387
100010000 | 1192
100010008 | 1192
100010096 | 1192
100010104 | 1192
100010112 | 1192
100011000 | 1191
100011008 | 1191
......
......
......
***************************************************
What I did in my ado program is to tabdisp "pat02" (binary codes used for
indicating inclusion or exclusion from my listwise nonmissing sample size
calculation) with "nomiscnt" (nonmissing case counts).