Announcement

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

  • Combining variables in the variable list by country

    I am looking at the dataset where I have three variable lists: life expectancy by country for specific age groups. The age interval for now is four years, and I would like to combine them (e.g. combine first 24 years 0 - 24) by country, so that the life expectancy is combined as well. Could you help me with what the easiest way would be? Thank you!

  • #2
    Terminology is a problem here. and I have a hard time knowing when you are using Stata terminology and when you are using your own.

    I have the impression that for you variable lists means something like distinct values of a variable and that you want groups of values in a new coarser variable. That could be quite wrong.

    Please give a data example. as requested and explained at https://www.statalist.org/forums/help#stata

    Comment


    • #3
      Originally posted by Nick Cox View Post
      Terminology is a problem here. and I have a hard time knowing when you are using Stata terminology and when you are using your own.

      I have the impression that for you variable lists means something like distinct values of a variable and that you want groups of values in a new coarser variable. That could be quite wrong.

      Please give a data example. as requested and explained at https://www.statalist.org/forums/help#stata
      I am quite new to Satata so apologies for confusing terminology.
      That is correct - I would like the groups of values in a new coarser variable.

      country age_group_name life_expectancy
      Argentina <1 year 59.57354
      Argentina 1 to 4 58.90747
      Argentina 5 to 9 46.25442
      Argentina 10 to 14 42.70732
      Argentina 15 to 19 37.11432
      Argentina 20 to 24 33.6641
      Argentina 25 to 29 30.22182
      Argentina 30 to 34 27.55699
      Argentina 35 to 39 24.27849
      Argentina 40 to 44 22.20945
      Argentina 45 to 49 20.92949

      I would like to have life expectancy for new age groups of 0 to 24, 25 to 39, and 40 to 49 for each country.
      I hope this explains it better.
      Thanks!

      Comment


      • #4
        Sorry, but that is not using dataex and leaves ambiguous whether age_group is string or a numeric variable with value labels.

        That can be clarified but I have no idea how life expectancy should be calculated for combined age groups. Do you have a precise technique for that? I wouldn't presume to mess with what is already calculated, but someone with expertise in demography or epidemiology may know much more.

        Comment

        Working...
        X