Announcement

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

  • consistency of main class variables

    Dear all,
    Hi, I have a dataset, where id identifies observation. Each id may represent a subclass of a single main class; for each id, I have a numeric "weight" variable vw. I have two main class variables, main_id1 and main_id2. I want to combine observations, with weights given by the relative size of the value-weight variable vw, so that "main_id" identifies the resulting dataset.

    There are cases where both main_id1 and main_id2 are non-missing. In such case, I want to make sure that two id's have the same main_id1 if and only if they have the same main_id2, so that main_id's are not weird.

    I'd like to ask if there's a way of doing this test.

    I'd be most grateful for your help. Thank you very much in advance!

    Best,

  • #2
    I don't really follow you, but it sounds like something for either egen . . ., group() missing or else collapse . . ., by().

    Comment


    • #3
      This question could be made better by giving a sample of your data structure, and then a sample of how you want it to look like in the end, even if you have to do it manually for a toy data set.

      Comment

      Working...
      X