Announcement

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

  • Add missing years

    Hello,
    i have a dataset from WIID, im interested in the Gini coeff. my problem now is i need a complete structure and not missing years.
    For a better unterstanding, the structure now is like e.g. 2000,2001,2003,2004,2007 the years 2002,2005 and 2006 are missing. How can i add now these missing years and add also for the gini variable for the missing data the "." ?
    I dont know exactly which years are missing for the whole dataset (countries).

    Thanks for kindfull help

  • #2
    I think you'll want to look into the -tsfill- command

    Comment


    • #3
      Sorry im a newbie, i tried but i have to set tsset and my variable, and have some problems, which variable i have to tsset? when im doing this for the year variable i got "repeated time values in sample"

      Comment


      • #4
        You have to specify the time-variable and the panel variable, so in your case probably
        Code:
        tsset country year
        Also see help tsset

        Comment


        • #5
          Thanks for your help, i checked help tsset but have a error message: varlist: country: string variable not allowed

          Comment


          • #6
            Originally posted by Tom Biermann View Post
            Thanks for your help, i checked help tsset but have a error message: varlist: country: string variable not allowed
            The error message tells you that the variable country is a string variable, which apparently tsset does not allow. The solution is to use encode to generate a numeric version. See help encode.

            Comment


            • #7

              encode country, gen(country1) --> the solution

              thanks a lot !!!!

              Comment


              • #8
                one time again me (sorry), my time range is from 1980-2010, the missing data worked fine like above when something is missing between, but if a country in my dataset starts with 1985 its not added the years before

                Comment


                • #9
                  Try something like

                  Code:
                  fillin country1 year

                  Comment


                  • #10
                    excellent !!! you both made my day

                    Comment

                    Working...
                    X