Announcement

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

  • How to deal with missing data

    Hello,

    I'm using the census to analyze female data. When I create dummy variable to all female proportion, the rest of the male data are missing, impacting the descriptive table's calculation.

    Is there any other way to solve this issue?

    Please kindly guide me ...

  • #2
    I'm not sure I understand what you did. How did you "create dummy variable to all female proportion?"

    Please show the code you used to create your dummy variable, the command(s) you are using to calculate the descriptive table, and also show example data that illustrates your problem. Use the -dataex- command to show the example data so that whoever helps you can work directly with a data set that is a realistic replication of what you have. If you are running version 18, 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    Comment


    • #3
      Clyde Schechter gives excellent advice as always.

      In addition, see Section 5 of https://journals.sagepub.com/doi/pdf...36867X19830921 on the importance of creating (1, 0) indicator variables, not (1, .) variables, which as I think you have found, are of limited use.

      Comment


      • #4
        Mya:
        as per previous advice, please read and act on the FAQ to post more effectively. Thanks.
        That said, my guess-work is that you coded something like (assuming that -"female"- is in -string- format):
        Code:
        gen my_categorical=1 if <whatever>=="female"
        but you missed the second part of the aforementioned code:
        Code:
        replace my_categorical=0 if <whatever>=="male"
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment

        Working...
        X