Announcement

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

  • collapse part of dataset

    Hi,

    I have a dataset with the education participation at regional and provincial levels coded in two different variables, every row is a province. For some countries province level data are missing. I would like then to consider regional level for these countries. Therefore I would like to collapse a part of my dataset for the missing data at provice level and consider only regional level. Should I do a collapse to obtain the mean at the regional level for these countries and then merge the datasets. If I doo so, how will I delete the remaining rows with missing data.
    Does anybody has a better idea? I attach part of my dataset

    Thank for your help

  • #2
    There was no example data with your post. (Attaching a data set is discouraged in any case; see FAQ #12 and use the -dataex- command instead.)

    That said, in general terms, if I understand you correctly, for some countries you have provincial data and for other countries you have regional data, and you want to collapse the provincial data up to the regional level. I assume that you already have a region variable that shows which region each province belongs to.

    So, I don't see a problem here. If you just do -collapse whatever, by(region)- you should get what you want. The countries that have only regional data will already have only a single observation per region, and -collapse- will leave those as is. The data from the countries that have provincial data will be aggregated up to the regional level by -collapse- and the whole thing will be a regional-level data set at the end.

    Am I missing something? Perhaps if I had seen your data I would see why there is a question.

    Comment

    Working...
    X