Announcement

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

  • Stata treating a number of datapoints of a variable as missing when it is not.

    I am working with a panel data with dimensions "country" and "year". When working with the data (regression, descriptive statistics, etc) I noticed that for variable x, state is reading all data points properly except for Mexico. In other words, for the same variable it is able to read properly most of the data but not these pertaining to Mexico. This is strange in my experience. The variable type is numeric and saved as float. I tried all of the following but with no success:

    - I tried to recast the variable to double and int. I was able to change it to double and after that to integer but in both cases the problem persisted.
    - I tried encoding the variable, I got an error that the variable is already numeric
    - I tried to go back to the excel file and copy the data and then past it (special) as values, and I tried as well changing the format to "number" and then save the changes as csv and then import back to STATA but the problem wasn't solved. Tried plain text format before importing into STATA and didn't work.
    - I tried to past the data directly to STATA in the data editor (it worked, but when I saved the data and reopened it gave me the same problem as before).

    Note, When I count the missing for the variable x it shows that the data for Mexico is missing
    When I try summarize for Mexico, I get all summary statistics for all variables except for x, where it shows that there is no observations.
    When I use regress just with Mexico data, I get an error that there are no observations.

    Any advice how to proceed or what is going on at least?

    Thanks.

  • #2
    Please post the command used to import the data and the data for Mexico as a .csv file. Copy and paste from the .csv to between CODE delimiters.


    Code:
    like this
    In other words, we need enough data and enough code to be able try to import ourselves.

    Comment

    Working...
    X