Announcement

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

  • Command for calculating household level expenditure

    Hi,

    I am working with the National Sample Survey Organization dataset from India. It is an individual level dataset but the consumption figures are of the entire household.
    The consumption figures are given item wise in the data set in terms of monthly per capita consumption expenditure
    There is a household id for each household and a person id as well.
    If I want to calculate the total annual household consumption expenditure of each household, what sepcific command of Stata do I use?

    The process that I followed was :
    1. convert the MPCE (in rupee terms) for 30 days into 365 days by multiplying and dividing by 365 and 30 respectively

    2.add the MPCE_365 for all individuals in the same household by using the bysort hhid command

    However, this does not give the correct figures because the consumption figures are household wise and not at the individual level.

    Thanks and regards,
    Meghna

  • #2
    It is difficult to imagine what your data is like. Even the best descriptions of data are no substitute for an actual example of the data. You will increase your chances of helpful response to this question by showing some example data. Choose a household containing more than one individual and show all the observations for the household, limiting the variables to the ones relevant to this problem, which I imagine to be the household and individual identifiers, and whatever is necessary to present the MPCE values that need to be added.

    Be sure to use the dataex command to present your data. If you are running version 15.1 or a fully updated version 14.2, dataex is already part of your official Stata installation. If not, run ssc install dataex to get it. Either way, run help dataex and read the simple instructions for using it. dataex will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    The command you want to run will be something like
    Code:
    dataex hhid indid var1 var2 ... if hhid==1234
    When asking for help with code, always show example data. When showing example data, always use dataex.

    Comment


    • #3
      Originally posted by William Lisowski View Post
      It is difficult to imagine what your data is like. Even the best descriptions of data are no substitute for an actual example of the data. You will increase your chances of helpful response to this question by showing some example data. Choose a household containing more than one individual and show all the observations for the household, limiting the variables to the ones relevant to this problem, which I imagine to be the household and individual identifiers, and whatever is necessary to present the MPCE values that need to be added.

      Be sure to use the dataex command to present your data. If you are running version 15.1 or a fully updated version 14.2, dataex is already part of your official Stata installation. If not, run ssc install dataex to get it. Either way, run help dataex and read the simple instructions for using it. dataex will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

      The command you want to run will be something like
      Code:
      dataex hhid indid var1 var2 ... if hhid==1234
      When asking for help with code, always show example data. When showing example data, always use dataex.
      Thank you so much for the response, I will definitely do that the next time I post a query about data.

      Comment


      • #4
        Hi Meghna,

        This may not be exactly what you are looking for, but you might take a look at these posts that use various techniques to manipulate / summarize household data. See here, here, and here. (Or search Statalist for "hhid").

        Hope that helps!
        --David

        Comment


        • #5
          Originally posted by David Benson View Post
          Hi Meghna,

          This may not be exactly what you are looking for, but you might take a look at these posts that use various techniques to manipulate / summarize household data. See here, here, and here. (Or search Statalist for "hhid").

          Hope that helps!
          --David
          Thank you so much David!!!The last link that you have sent is really helpful.

          Comment

          Working...
          X