Dear Statalist,
I have a trouble to generate a table count the number and proportion of people who remained abstinent at 1 to 12 months of life, given days of abstinence from smoking. i.e. 10 people remain abstinent for 30 days, 30 people remain abstinent for 365 days
month Remain abstinent
2 10
12 30
Code:
gen monthly_resumed= Day_abs/30

. table monthly_resumed, contents(count Day_abs proportion Day_abs)
I got this:
Code:
proportion invalid
And I tried without computing proportion, I got this:
Code:
----------------------
monthly_r |
esumed    | N(Day_abs)
----------+-----------
        0 |         13
 .0333333 |         15
 .0666667 |         20
       .1 |         19
 .1333333 |         10
 .1666667 |          6
       .2 |          6
 .2333333 |         10
 .2666667 |          2
       .3 |          2
 .3333333 |          2
 .3666667 |          3
       .4 |          3
 .4333333 |          4
 .4666667 |         11
       .5 |          5
 .5333334 |          4
 .5666667 |          1
 .6666667 |          3
       .7 |          6
 .8333333 |          2
 .8666667 |          1
 .9666666 |          1
        1 |          3
 1.066667 |          1
      1.1 |          2
 1.166667 |          2
      1.2 |          1
 1.366667 |          1
      1.4 |          1
      1.5 |          3
 1.566667 |          3
      1.8 |          1
 1.833333 |          1
        2 |          2
 2.066667 |          1
      2.1 |          1
Any help would be appreciated!