Announcement

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

  • no observatin panel data

    Hi,
    Im writing my thesis and I am using data from the last 17 years of 26 different countries. I have made made the variable countrynumber and made it time dependent

    xtset countrynumber year, yearly
    panel variable: countrynumber (strongly balanced)
    time variable: year, 2000 to 2017
    delta: 1 year



    I am trying to make a regression using the xtreg command. This works with certain variables, but not with others. It gives the error of no observations (r(2000)). The variables that give these error are called PESandadministration,Training, Employmentincentives, Shelterendandsupportedemploym, Activemeasures1070, Percentageofemployeeswiththe, Vakbondendichtheidpercentage. I have tried replacing the missing variables with the variable from previous years by using the command
    by countrynumber (year), sort: replace myvar = myvar[_n-1] if myvar >= . but it says either weights are not allowed or type mismatch.

    I was hoping someone can help me with this.

  • #2
    Welcome to the Stata Forum/Statalist,

    Please type - describe - and check whether the "missing-value" variables are string ones.
    Best regards,

    Marcos

    Comment


    • #3
      They are string variables yes, thank you. Should I try to change them and if yes how do I do that? As you might notice I have very basic skills when it comes to STATA.

      Comment


      • #4
        Michelle:
        see -help destring-.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Carlo gave excellent advice.

          Just as a side note, please read the FAQ, particularly the topic about sharing data/command/output. You may use - dataex - or CODE delimiters for that matter.

          That said, destring will work fine is all values are numbers, otherwise may need to use the - force - option. If the variable has "words", I mean, if it is a nominal variable, you may - encode - the variable.

          Again, that best approach is sharing a parcel of the data, as recommended in the FAQ. You may also find interesting information in the Stata Manual or by typing - help encode - or - help destring - in the Command Window.
          Best regards,

          Marcos

          Comment

          Working...
          X