Announcement

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

  • No Observations r(2000) Error

    Hi there,

    I have consulted the various forum posts about error r(2000) but none of the fixes have worked.

    I have:

    - replaced all missing values with a dot
    - ensured that all variables are numeric

    I am trying to run xtreg and it is at this final step that the error r(2000) comes up.

    Could anyone please help? Thanks!


  • #2
    Replacing missing values with a dot, just keeps them missing--it accomplishes nothing.

    Remember that xtreg (or any regression model) will only include observations where none of the variables in the model have missing values. If every observation in your data set has a missing value for some variable in the model, then you are left with no observations. A common situation that gives rise to it is when a particular variable is defined only for a subset of the observations and some other variable is defined only for the complementary subset of obeservations. Perhaps you have a pair of such variables?

    For more specific help you need to show us a sample of the data. Please use the -dataex- program (-ssc install dataex-, if you don't already have it) to create the code to generate a suitable sample and past the output of -dataex- into a code block (see FAQ if you don't know how to set up a code block) on this forum in your next post.

    Comment


    • #3
      In addition to Clyde's excellent advice, note other ways to find out about missing values:

      misstable http://www.stata.com/help.cgi?misstable

      missingplot (SSC) http://www.stata.com/statalist/archi.../msg00154.html

      missings (SSC) http://www.statalist.org/forums/foru...aging-missings

      An article on missings will appear in Stata Journal 15(4) (2015)

      Comment

      Working...
      X