Announcement

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

  • STATA counts 'no values' as dots in variables

    Hi,

    I have a data sheet with several values including age. From that data I have created groups/variables according to age. When I open a group for a specific age set, the data for each person with the specified age is contained in the file. However the persons excluded from the data due to unwanted age in the specific file is left as dots. This means that when calculating using a set based on age it counts every person from the data set and not just the chosen age. Numbers are correct but the count is wrong as in 100 persons in the data set but only 35 for the specific age. So when doing a summarize the count isn't 35 but 100.

    What can I do to remove the unwanted data displayed as dots in my variables?

  • #2
    I can't follow your question easily. Please do read and act on https://www.statalist.org/forums/help#stata which requests posting of data examples and of the exact code that you used. In #1 you don't give either of those.

    While you're visiting, take a quick detour to https://www.statalist.org/forums/help#spelling.

    Stata reports missing numeric values as periods (the word often used in documentation) or dots (your word). For an overview, read

    Code:
    help missing
    At a guess you used some command with an if qualifier. Let's see the principle with a silly example, but using commands you can type too, as the dataset is bundled with Stata.


    Code:
    . sysuse auto
    (1978 Automobile Data)
    
    . gen mpg_foreign = mpg if foreign == 1
    (52 missing values generated)
    If you use an if qualifier in this way, selecting some observations, then Stata does not know what you want to do if the selection condition is not satisfied. So it assigns missing values for the other observations, and a list or edit of the data will show periods (or dots).

    You should not think that you need to remove the observations with missing values. Occasionally that's a good idea, but usually it isn't.

    The nub of your question is that you think a count reported by Stata from some unspecified command is wrong, or at least not what you want. I will stop guessing at this point, as that could be almost anything from a problem in your code to a misunderstanding of what is happening.

    So, I hope that helps, but I suspect that you need to act on my opening suggestions to get a fuller answer.





    Comment

    Working...
    X