Announcement

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

  • Plotting Graph

    Hi all,

    I have data from a survey on prices individuals are willing to pay for a product. In particular, each participant had to provide a price for each of the variables OE, DC_Price and P_Basic.

    Click image for larger version

Name:	Screen Shot 2022-12-10 at 12.05.41.png
Views:	1
Size:	32.0 KB
ID:	1692829



    I need to plot the aggregate demand curves for the three variables on the same graph (Just like the image below). Here the x-axis is Price and the Y-axis is Quantity (normalised).
    The curves should show the aggregate demand based on aggregating individuals' responses to the OE, DC_Price and P_Basic questions.
    Here quantity should be the aggregate demand that is normalized to a range between 0 and 1 due to differing sample sizes.

    Click image for larger version

Name:	Screen Shot 2022-12-09 at 16.48.26.png
Views:	3
Size:	52.8 KB
ID:	1692830


    My idea is to create a histogram overlaying all three variables and somehow turning this into a connected line graph? However, I doubt this takes into account aggregating the individuals responses and based on what I have read in this forum one cannot create a line graph from a histogram?
    Below is a screenshot of the histogram for just the OE variable.
    histogram OE, bin(20) frequency xtitle(Price) xlabel(#20, labels ticks)

    Click image for larger version

Name:	Screen Shot 2022-12-10 at 12.14.14.png
Views:	1
Size:	23.0 KB
ID:	1692831


    Is there perhaps an easier way to plotting these demand curves? Or any other suggestion on how to go about this?

    Any recommendations or guidance would be greatly appreciated.

    Thanks,
    Carmen


  • #2
    carmen campagnolo Screenshots are not a particularly useful way to provide your data sample. Please use the dataex command instead, as advised in the Statalist FAQ.

    Comment


    • #3
      Hi Hemanshu Kumar thanks for pointing this out.

      My data looks like this

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input int(id OE DC_Price P_Basic)
      25  30   0  41
      26  25   0  36
      27 100   0 111
      28  80  99  91
      29  50   0  61
      30 100   0 111
      31   .   0   .
      32  32   0  43
      33  50   0  61
      34  60   0  71
      35  50   0  61
      36  90   0 101
      37 100  59 111
      38  55   0  66
      39 100   0 111
      40 200  99 211
      41 150  49 161
      42 200 139 211
      43  55   0  66
      44  22   0  33
      end

      Comment

      Working...
      X