Announcement

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

  • Generate household-level variable, calculated at neighborhood-level

    Generate household-level variable, calculated at neighborhood-level

    Hi all,
    I have tabulated the ratio of total males to females for each neighborhood (which, in turn belongs to a province). The problem is that the dataset is household-level and the last two are only identifier variables, so I am not being able to generate the ratio household-wise. I want to assign the tabulated neighborhood ratio to each household in that particular neighborhood (and province) [ so every household in a particular locality will have the same value of the ratio]. But I can't think of a way to do this, except manually.
    That's probably because I am relatively inexperienced with stata.
    Looking forward to suggestions.
    Thanks,
    Rani

  • #2
    It would have been helpful to show an example of your data. Without knowing how your variables are organized, it is impossible to suggest a solution. In fact, based on your description, I don't even understand why there is any problem at all here: whatever variable you have calculated at the neighborhood level would automatically already have the same value in each household. So clearly my understanding of your data description is not correct. (Or perhaps your description is not correct.)

    So, the first thing is to install the -dataex- command by running -ssc install dataex-. Then run -help dataex- and read the simple instructions for how to use it. Then use it to post an example of your data back here with that example data, and a brief explanation indicating which variables represent what in relationship to your specific question. Then it is likely that a helpful response will be obtained in a timely manner.

    Comment


    • #3
      My sincere apologies. What I posted is itself an example, but not an accurate one.
      Let me put it this way:
      The data set has a variable which describes, say, the race-wise break-up of entire sample of households. I use the frequency distribution of this variable to arrive at the ratio of one race to the other (for each neighborhood/sub-population). I do this because I am interested in the race composition of the neighborhood in which a household resides. As opposed to the gender example that I gave earlier, such a composition is not available at the household-level (since a household can only have one particular value of race), and hence does not automatically have any value (as you rightly said that a gender variable would have). I now want to allocate this neighborhood race composition to each household.
      I hope this makes more sense now.
      Thanks

      Comment


      • #4
        I'm sorry, but I don't find this any clearer. To some extent it gives me a better understanding of what you want to end up with, but it does not clarify how the data you have look. If you want directions from A to B, both A and B have to be known. Please show some example data, using the -dataex- command, as previously requested.

        Comment

        Working...
        X