Announcement

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

  • Plotting relative frequences in graph

    In my dataset, each row is a sale and in my data each sale is a referral or not, captured by the variable "referral." Another variable captures the type of product, called product type. I've been able to plot the number of referrals per product type. And what I'd like to plot is the number of referrals per product type, divided by the total number of sales per product type. How can I best approach this issue?

    The code for my current plot is the following:
    Code:
    graph bar (count),  over(product_type)

  • #2
    Hi Dougie. The examples in this FAQ might give you some ideas. See the graph at the bottom, and notice that for for a dichotomous variable with 0/1 coding, the mean = the proportion of 1s.

    HTH.
    --
    Bruce Weaver
    Email: [email protected]
    Web: http://sites.google.com/a/lakeheadu.ca/bweaver/
    Version: Stata/MP 18.0 (Windows)

    Comment

    Working...
    X