Announcement

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

  • Plotting graphs using output from the table command

    Hello,

    I am using the table command in STATA to generate summary statistics over various rounds of a survey and over subpopulations in my dataset. For example, I see how ownership of clean fuel has changed over successive survey rounds among various households belonging to different wealth deciles. My command is:

    Code:
    table (nfhs_round) (wealth_category) [iweight=wgt], statistic(mean clean_fuel)
    where nfhs_round is the survey round, wealth category is a categorical variable that assumes values 1,2,3..for different wealth deciles, and clean_fuel is a dummy variable that takes the value 1 if the household owns a clean fuel source and 0 otherwise.

    Immediately after running the command, I want to plot a line graph that shows how clean ownership changes over time among different wealth deciles. Right now, I am exporting the output from the table command and plotting it in Excel. Is there a way to do so directly in Stata?

    Thank you very much,

    Regards,
    Kanika

  • #2
    Does anyone know how to go about it? Would save me a lot of time.

    Comment


    • #3
      Code:
      table (nfhs_round) (wealth_category) [iweight=wgt], statistic(mean clean_fuel)
      
      frame copy default tograph
      frame change tograph
      collapse (mean) clean_fuel [iw=wgt], by(nfhs_round wealth_category)
      separate clean_fuel, by(wealth_category) veryshortlabel
      rename clean_fuel copy
      twoway line clean_fuel* nfhs_round
      frame change default
      ---------------------------------
      Maarten L. Buis
      University of Konstanz
      Department of history and sociology
      box 40
      78457 Konstanz
      Germany
      http://www.maartenbuis.nl
      ---------------------------------

      Comment


      • #4
        Thank you so so much!

        Comment

        Working...
        X