Announcement

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

  • r(2000) no observations? I have tried 'destring', but then it says 'already numeric; no generate

    Hello
    I am trying to make a regression using mlogit.
    But once I enter a specific one of my variables, it says r(2000) no observations. I have tried using the desting command, but then it says that my variables are already numberic? And now I don't know what to do

    Best Regards Marie
    A helpless student

  • #2
    Check out -dataex- and post some minimal example of data that generates the problem using -dataex-.

    This error might be caused because the problematic variable is a string, or because the problematic variable has too many missing values.

    We cannot tell you unless you show us a subset of your data that generates the problem.

    Comment


    • #3
      To expand on Joro's insightful comment, if the variable happened to have missing values for all the cases where the other variables have non-missing values, you could end up with no usable cases. This can happen naturally but could also happen if you don't get the if conditions right on a generate statement.

      You might also want to run a regression and see what you get. You could also could run the mlogit with all the variables that work, then generate a variable that indicates whether the observation was used:
      gen used=e(sample)

      Then look at the values of the additional variable for observations where used==1. It is often good practice to look at the data.

      Comment

      Working...
      X