Announcement

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

  • Ploting age profiles of consumptions

    Dear All,
    Please see attached an image, taken from Deaton (1997). Using a different dataset, how can one replicate the Fig 6.2 in the attached picture?
    Thank you very much,
    Dapel
    Attached Files

  • #2
    With household survey data, you will usually need to first aggregate incomes or expenditure of the household members. If you are only considering the income or expenditure of the household head, then this is not necessary. There may also be some preliminary aggregation of specific income and expenditure components before you arrive at the final figure.

    Then you want to average over age

    Code:
    *// Income Profile, Urban 1986
    by age_of_household_head: egen IncomeU86  = mean (income) if urban==1 & year==1986
    
    *// Consumption Profile, Rural 1987
    by age_of_household_head: egen ConsumptionR87  = mean (consumption) if urban==0 & year==1987

    Then use -lowess- or -lpoly- to plot

    Code:
    twoway (lowess IncomeU86 age_of_household_head)(lowess ConsumptionU86 age_of_household_head) if urban==1 & year==1986 ,legend( order(1 "Urban Income 1986" 2 "Urban Consumption 1986") )
    
    twoway (lpoly IncomeR87 age_of_household_head)(lpoly ConsumptionR87 age_of_household_head) if urban==0 & year==1987 ,legend( order(1 "Rural Income 1987" 2 "Rural Consumption 1987") )
    Last edited by Andrew Musau; 05 Mar 2017, 07:56.

    Comment


    • #3
      Dear Andrew,
      Thanks a million for the codes! After customizing the codes (I restricted to consumption and combine the sectors (i.e urban and rural)) or
      Code:
      bysort age: egen cpce2015  = mean (pce2015) if year==1980
      twoway (lowess cpce2015 age)(lowess cpce2015 age) if year==1980 ,legend( order(1 "Consumption 1980") )
      and I got this: (please see below):

      How can one represent age-consumption profile for each of the years on a single graph such that each line on the graph depicts a year? Refering to graph in black and white below:
      Attached Files
      Last edited by Zuhumnan Dapel; 05 Mar 2017, 09:19.

      Comment


      • #4
        Place the if conditions within the brackets

        Code:
         
         twoway (lowess cpce1980 age if year==1980)(lowess cpce1981 age if year==1981)...

        Comment


        • #5
          Thank you very much. The age-consumption relation looks a bit different to me. Meaning from early years, consumption starts to fall with age consistently; and in some years starts to rise after falling?
          Attached Files

          Comment


          • #6
            1) That sounds about right. But with these graphs, values are high in the tales of the age distribution, and this may be due to the fact that there are few respondents in the tales. Therefore, an outlier in these age categories may have a large impact on the mean. You should caution your readers about drawing any conclusions about the consumption levels in the tales of the age distribution of the sample.

            2) Empirically, the black and white picture that you attach looks more realistic. You should check whether this is a problem with your sample. Expenditure increases as one gets a family in the 20-40 category and declines as one retires 60+
            Last edited by Andrew Musau; 05 Mar 2017, 10:09.

            Comment


            • #7
              Thanks a lot for pointing out these. Now I get. I was using Per Capita Expenditure (PCE). Now I used total household consumption expenditure = hhsize*PCE. I got:
              Attached Files

              Comment


              • #8
                Great! This looks more like what you would expect.

                Comment


                • #9
                  Thanks for confirming this! I wonder why curves are smoother than Deaton's. Also, is consumption falling with age after a peak because the household size also shrinks?
                  Last edited by Zuhumnan Dapel; 05 Mar 2017, 14:46.

                  Comment


                  • #10
                    Thanks for confirming this! I wonder why curves are smoother than Deaton's.
                    The smoothness is a property of -lowess- (locally weighted scatterplot smoothing, see help lowess) . Try out -lpoly- if you don't like the look of -lowess-


                    Also, is consumption falling with age after a peak because the household size also shrinks?.
                    That is certainly a viable explanation. But since you have the data, you can verify whether this is the case, e.g.,


                    Code:
                    *\\ OVER 5-YEAR PERIODS
                    gen age5= 5*ceil(age/5)
                    graph bar household_size, over(age5)
                    
                    *\\ OVER 10-YEAR PERIODS
                    gen age10= 10*ceil(age/10)
                    graph bar household_size, over(age10)
                    After 40 years, the heights of the bars should decrease as the age category increases.

                    Comment


                    • #11
                      Thank you so much for these clarifications.

                      Dapel

                      Comment


                      • #12
                        The spike, begining from 90-year olds, could this be an outlier? I used lpoly
                        Attached Files

                        Comment


                        • #13
                          It most probably is. As I said in #6, if the number of respondents is low in the tails of the age distribution, then an outlier will have a large impact on the mean. You can take a hint from Deaton who restricts his sample to 20-70 years, but chances are his data extends beyond 70 years. Do a tabulation of age and number of respondents and then find a suitable cut off age. For example, if less than 2% respondents are aged 80 years and over, then it makes little sense in including them in your graph.

                          #9 Another reason why consumption may be declining may be due to Friedman's permanent income hypothesis: At age 60, respondents expect their future incomes to decline because they are soon exiting the labor force and hence adjust their consumption downwards. Therefore, you should also plot income and see whether it does decline in the sample after the age of 60.


                          Reference

                          Friedman, Milton (1957). "The Permanent Income Hypothesis" A Theory of the Consumption Function. Princeton University Press.

                          Comment


                          • #14
                            Thank you so much for shading light on this. If I restrict the sample to 20-70 year-olds, 6% + of the observations will be truncated. But if adjusted up 80 year-olds, less than 2% will be truncated. Here is what I got with this:
                            Attached Files

                            Comment


                            • #15
                              This looks fine to me.

                              Comment

                              Working...
                              X