Announcement

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

  • how to deal with a variable that used two Unit of measurement over time

    Hello everyone
    I have a question. appreciate if someone can help.
    in a panel data regression, one of the ind. Var has two ranges of values due to changes in the method of calculation of that variable. In the first 10 years the var ranges between 1 to 7 and the next 10 years it ranges from 5 to 60. I was thinking to use two-period panel data. Is it the right approach? And how to arrange dataset for that purpose

  • #2
    If it's just the scale that changed, you can rescale one set of values to correspond to the other and have a single scale (e.g., see the transformation below where I assume that the values are integers). Otherwise, you need to provide more details about the variable and scale changes.

    Code:
    clear
    set seed 04172023
    set obs 1000
    gen var= runiformint(5, 60)
    sum var
    gen wanted= ceil((var-4)/8)
    sum wanted
    Res.:

    Code:
    . sum var
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
             var |      1,000      33.806     15.9925          5         60
    
    .
    . gen wanted= ceil((var-4)/8)
    
    .
    . sum wanted
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
          wanted |      1,000        4.17    1.990744          1          7
    Last edited by Andrew Musau; 17 Apr 2023, 05:59.

    Comment


    • #3
      thank you

      Comment

      Working...
      X