Announcement

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

  • Replace missing values with observations randomly generated based on a prespecified criteria

    Hi everyone,

    I am using DHS data for all countries for some exploratory analysis. The variable religion in the DHS dataset has some missing values for some countries (either whole or partly).

    a) For countries where religion is missing completely:

    From external sources, I can get the proportion of people that belong to a certain religion in a specific country. Say for instance India (country code=10) is 94% Hinduism (religion_code=1), 3% Muslims (religion_code=2), 2 Christians (religion_code=3), and 1% others (religion_code=4). Is there a way I can replace the missing values for religion in India in a random manner but based on the criteria above? i.e. randomly replace 94% missing values in religion for India with 1 (i.e. Hinduism), 2 (Muslim) and so on.

    b) For countries where religion is partly missing

    How to replace the missing values randomly based on the existing distribution of religion data for that country. So if a particular country has 50% Hindus and 50% Christians, then 50% of the religion's missing values are replaced by Hindus and son on.

    Any help on this will be appreciated.

    Danish

    P.S. I understand that I'll have to calculate religion shares for each country and each year separately. For now, however, let's assume the religion shares remain constant across all years.

  • #2
    See https://www.stata-journal.com/articl...article=pr0032 for a write-up. Now the documented name is runiform() but uniform() still works.

    See also https://www.merriam-webster.com/word...plural-grammar for a discussion of a small usage question.

    Comment


    • #3
      Originally posted by Nick Cox View Post
      See https://www.stata-journal.com/articl...article=pr0032 for a write-up. Now the documented name is runiform() but uniform() still works.

      See also https://www.merriam-webster.com/word...plural-grammar for a discussion of a small usage question.
      Great recommendations, thank you.

      Comment


      • #4
        Originally posted by danishussalam View Post
        Hi everyone,

        I am using DHS data for all countries for some exploratory analysis. The variable religion in the DHS dataset has some missing values for some countries (either whole or partly).

        a) For countries where religion is missing completely:

        From external sources, I can get the proportion of people that belong to a certain religion in a specific country. Say for instance India (country code=10) is 94% Hinduism (religion_code=1), 3% Muslims (religion_code=2), 2 Christians (religion_code=3), and 1% others (religion_code=4). Is there a way I can replace the missing values for religion in India in a random manner but based on the criteria above? i.e. randomly replace 94% missing values in religion for India with 1 (i.e. Hinduism), 2 (Muslim) and so on.

        b) For countries where religion is partly missing

        How to replace the missing values randomly based on the existing distribution of religion data for that country. So if a particular country has 50% Hindus and 50% Christians, then 50% of the religion's missing values are replaced by Hindus and son on.

        Any help on this will be appreciated.

        In general, I understand that a lot lies in a positive attitude and a lot depends on it in our lives. I understand that the fact that I can't solve some issues in the course of my career growth shows that I need to learn to think positively. I found a lot of cool research on positive thinking at https://studyhippo.com/essay-example...tive-attitude/ I hope it helps me.

        Danish

        P.S. I understand that I'll have to calculate religion shares for each country and each year separately. For now, however, let's assume the religion shares remain constant across all years.
        I, too, am interested in the solution to this question.

        Comment

        Working...
        X