Announcement

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

  • Command for estimating household consumption aggregate

    Hello Statalist,

    Here is a preview of my dataset

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long hhid int item_cd long s10bq10
    10001 10    .
    10001 11    .
    10001 13    .
    10001 14    .
    10001 16    .
    10001 17    .
    10001 18    .
    10001 19    .
    10001 20    .
    10001 22    .
    10001 23    .
    10001 25  750
    10001 26    .
    10001 27    .
    10001 28  150
    10001 29    .
    10001 30    .
    10001 31  700
    10001 32    .
    10001 33  350
    10001 34    .
    10001 35  400
    10001 36  200
    10001 37    .
    10001 38    .
    10001 40    .
    10001 41    .
    10001 42 1000
    10001 43  200
    10001 44    .
    10001 45    .
    10001 46    .
    10001 47    .
    10001 48    .
    10001 50  350
    10001 51    .
    10001 52  450
    10001 53    .
    10001 56    .
    10001 60  300
    10001 61    .
    10001 62    .
    10001 63    .
    10001 64    .
    10001 65    .
    10001 66    .
    10001 67  200
    10001 68  300
    10001 69    .
    10001 70  400
    end
    label values item_cd LABA
    label def LABA 10 "10. Guinea corn/sorghum", modify
    label def LABA 11 "11. Millet", modify
    label def LABA 13 "13. Rice  - local", modify
    label def LABA 14 "14. Rice - imported", modify
    label def LABA 16 "16. Maize flour", modify
    label def LABA 17 "17. Yam flour", modify
    label def LABA 18 "18. Cassava  flour", modify
    label def LABA 19 "19. Wheat flour", modify
    label def LABA 20 "20. Maize (On the cob)", modify
    label def LABA 22 "22. Maize (Off the cob/grains)", modify
    label def LABA 23 "23. Other grains and flour (specify)", modify
    label def LABA 25 "25. Bread", modify
    label def LABA 26 "26. Cake", modify
    label def LABA 27 "27. Buns/Pofpof/Donuts", modify
    label def LABA 28 "28. Biscuits", modify
    label def LABA 29 "29. Meat Pie/Sausage Roll", modify
    label def LABA 30 "30. Cassava - roots", modify
    label def LABA 31 "31. Yam - roots", modify
    label def LABA 32 "32. Gari - white", modify
    label def LABA 33 "33. Gari - yellow", modify
    label def LABA 34 "34. Cocoyam", modify
    label def LABA 35 "35. Plantains", modify
    label def LABA 36 "36. Sweet potatoes", modify
    label def LABA 37 "37. Potatoes", modify
    label def LABA 38 "38. Other roots and tuber", modify
    label def LABA 40 "40. Soya beans", modify
    label def LABA 41 "41. Brown beans", modify
    label def LABA 42 "42. White beans", modify
    label def LABA 43 "43. Groundnuts (Unshelled, in the pod)", modify
    label def LABA 44 "44. Groundnuts (Shelled, removed from the pod)", modify
    label def LABA 45 "45. Other nuts/seeds/pulses", modify
    label def LABA 46 "46. Coconut", modify
    label def LABA 47 "47. Kola nut", modify
    label def LABA 48 "48. Cashew nut", modify
    label def LABA 50 "50. Palm oil", modify
    label def LABA 51 "51. Butter/ Margarine", modify
    label def LABA 52 "52. Groundnuts Oil", modify
    label def LABA 53 "53. Other oil and Fat(specify)", modify
    label def LABA 56 "56. Animal fat", modify
    label def LABA 60 "60. Bananas", modify
    label def LABA 61 "61. Orange/tangerine", modify
    label def LABA 62 "62. Mangoes", modify
    label def LABA 63 "63. Avocado pear", modify
    label def LABA 64 "64. Pineapples", modify
    label def LABA 65 "65. Fruit canned", modify
    label def LABA 66 "66. Other fruits(specify)", modify
    label def LABA 67 "67. Pawpaw", modify
    label def LABA 68 "68. Watermelon", modify
    label def LABA 69 "69. Apples", modify
    label def LABA 70 "70. Tomatoes", modify
    label var hhid "Household Identification" 
    label var item_cd "Roster instance identifier" 
    label var s10bq10 "How much did your household spend on the most recent purchase of [ITEM]?"
    The data above is on the households' food expenditure. For each household, it's expenditure on different food items is provided. I want to estimate the household consumption aggregate, that is, the total consumption expenditure for each household.
    Please, how do I go about estimating this?

    Thanks so much in advance.

  • #2
    it is unclear what role item_cd is meant to play here, but try this (which gives one value for each observation in an hhid):
    Code:
    bys hhid: egen double tot_consumption=total(s10bq10)
    obviously, you should name the new variable whatever you want

    Comment


    • #3
      Thank you so much Rich for your reply. But what does "double" represent in this case

      Comment


      • #4
        Code:
        help data_types

        Comment


        • #5
          Thank you very much Rich

          Comment

          Working...
          X