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:

After recode:

as you can see, sex dimension has 2 levels before but 4 levels after recode.
I will appreciate any comment.
cheers
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:
After recode:
as you can see, sex dimension has 2 levels before but 4 levels after recode.
I will appreciate any comment.
cheers