Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: weight option

From   "Pablo Bonilla" <>
Subject   Re: st: weight option
Date   Thu, 23 Aug 2012 19:38:52 +0000

I would use frequency weights so Stata will understand that your obs are replicated as many times as the weights says to be.

graph pie hits [fweight=doc_published], over(analyst) ,


Sent via BlackBerry from T-Mobile

-----Original Message-----
From: tashi lama <>
Date: Thu, 23 Aug 2012 19:32:20 
To: <>
Reply-To: statalist@hsphsun2.harvard.eduSubject: st: weight option

 Hello all, 

The problem is creating a market share of analysts based on the readership views but also that take into account how many documents were published by the analysts. For instance the guy with 20 views on just 2 documents published should have higher market share than the guy who has 25 views on 5 documents published. Say for instance my dataset would look something like this

          analyst   doc_published   hits 
  |       A          5          25 |
  |       B          3          20 |
   |       C          1          18 |
   |       D          2          20 |
  |       E          4          12 |

If I were to draw a pie chart, I would simply do 
graph pie hits, over(analyst) 
This will indeed give me a nice looking pie chart but this doesn't take document published (which is in column 2) into account. However, I want to be able to create a market share of analysts' based on readership hits but also takes document published into account. I have a feeling it has to do something with [weight] option. Could someone please explain which weight should I use and may be why it would be better than others? 
it could be something like this
graph pie hits [weight=doc_published], over(analyst) 

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index