Announcement

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

  • #16
    Regarding #14, I think we need to be on the same understanding about that condition "& CAE_02".

    CAE_02 is a continuous variable consisting of ratio. If the condition is "if CAE_02", then all of the values will be "1" as (TRUE) except if CAE_02 is equal to 0 as (FALSE). Here is an example:

    Code:
    clear
    input y
    0
    1
    .
    3
    4
    end
    
    list if y
    Results:

    Code:
         +---+
         | y |
         |---|
      2. | 1 |
      3. | . |
      4. | 3 |
      5. | 4 |
         +---+
    So, what is typed in #14 does not make sense to me.

    Comment


    • #17
      Originally posted by William Lisowski View Post
      Please don't overlook post #12.
      Now I got it. The variable ratio in #12 is equal to -wanted in #14.

      I am sorry prof William. I am neither good in Stata nor smart as you. As always, short, good-looking and smart path. Perfeito!
      Thank you so so much.

      Comment


      • #18
        Something weird happened.
        Yesterday, the code worked. Today, I started to do it again, this time creating only missing values. The code is exactly the same.
        Code:
        * Example generated by -dataex-. For more info, type help dataex
        clear
        input int Year double(Value_10 Value_11 Value_12 Value_13)
        2010 11525.832 2769.224  516.39  3151.34
        2011 12170.209 2681.582 512.334 3187.776
        2012  12314.61 2716.226 518.181 3149.791
        2013 12585.174 2758.651 562.745 3318.434
        2014 12402.414 2877.732 679.631 3465.404
        2015 12446.254 2928.394 776.283 3638.196
        2016 12688.346  3025.13 758.333 3694.551
        2017 13484.054 3165.034 653.822 3927.094
        2018 13772.871 3203.525 677.202 4002.867
        2019 13979.106 3357.809 689.364 3889.002
        2020 13485.966 3065.785 765.926 3659.808
        end
        
        foreach sfx in 10 11 12 13 {
            generate Def_y_`sfx' = Value_`sfx'/Value_`sfx'[_n-1]
        }
          3. }
        (1 missing value generated)
        (1 missing value generated)
        (1 missing value generated)
        (1 missing value generated)
        (1 missing value generated)
        (1 missing value generated)
        (1 missing value generated)
        (1 missing value generated)
        (1 missing value generated)
        (1 missing value generated)
        I really got shocked!

        Comment

        Working...
        X