Announcement

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

  • Collect: Preserving Level Label During Remap

    Hello, is there a way to preserve the level label during a remapping? As an example:

    Code:
    sysuse auto, clear
    
    table (var) (rep78), statistic(fvpercent foreign)
    
    collect remap var[0.foreign] = newthing
    
    collect layout (newthing) (rep78)
    Ideally, the earlier label would display rather than 0.foreign. Thank you.

  • #2
    You need to assign the label to that level of the dimension.

    Code:
    sysuse auto, clear
    table (var) (rep78), statistic(fvpercent foreign)
    collect remap var[0.foreign] = newthing
    collect label levels newthing 0.foreign `:lab (foreign) 0'
    collect layout (newthing) (rep78)
    Res.:


    Code:
    . 
    . collect layout (newthing) (rep78)
    
    Collection: Table
          Rows: newthing
       Columns: rep78
       Table 1: 2 x 6
    
    -------------------------------------------------------
               |              Repair record 1978           
               |    1     2    3    4          5      Total
    -----------+-------------------------------------------
    newthing   |                                           
      Domestic |  100   100   90   50   18.18182   69.56522
    -------------------------------------------------------

    Comment


    • #3
      Perfect - thank you for your help!

      Comment

      Working...
      X