Announcement

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

  • test

    Hi,

    I am new to Stata and was wondering if someone could help me with following question:

    I imported a census sample file using insheet, and now have a variable (v1) equal to one if the observation is at the family-level, and equal to zero if the observation is at the personal-level. So the data looks something like this (where the . denote missing information for a given variable):

    v1 v2 v3 v4 v5
    1 1 0 . .
    0 . . 4 3
    0 . . 4 3
    1 2 0 . .
    0 . . 4 3


    Hence, v2 and v3 describe family characteristics (e.g. family income), and variables v3 v4 and v5 describe characteristics of individuals in each family. In the example above, there are 2 families: one with two individuals, and another one with one individual. I do not know how to link family-level characteristics to personal-level characteristics, so that the dataset looks something like this:

    v1 v2 v3 v4 v5
    1 1 0 . .
    0 1 0 4 3
    0 1 0 4 3
    1 2 0 . .
    0 2 0 4 3


    I do not have id variables for families or individuals; the only way I know that a person is in a given family by looking at the dataset, is since a row containing family information is followed by the personal-level information of each of it's members. Any ideas how to do this in Stata?

Working...
X