Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Collect recode problem

    Hi
    I am working with the new table and collect command in STATA 17.
    After I recode levels of a dimension, the "collect dims" command shows that the dimension has both oldlevel and newlevel.
    how can I remove old levels?
    This is the code used in STATA table-document:

    use https://www.stata-press.com/data/r17/nhanes2l
    collect clear
    sort sex region
    collect: by sex region: summarize weight
    collect dims
    collect recode sex 1 = Male 2 = Female
    collect dims

    The result of "collect dims" :

    before recode:
    Click image for larger version

Name:	before.JPG
Views:	2
Size:	35.2 KB
ID:	1642324

    After recode:
    Click image for larger version

Name:	After.JPG
Views:	1
Size:	36.2 KB
ID:	1642325


    as you can see, sex dimension has 2 levels before but 4 levels after recode.
    I will appreciate any comment.

    cheers
    Attached Files
Working...
X