Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: How to calculate weighted mean


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: How to calculate weighted mean
Date   Thu, 5 Dec 2013 18:12:15 +0000

That is a user-written program from SSC. You need to install it using

. ssc inst _gwtmean


Nick
njcoxstata@gmail.com


On 5 December 2013 18:07, Xixi Lin <winnielxx@gmail.com> wrote:
> Hi,
>
> I am trying to calculate weighted average return by country and by
> period. Here is my code:
> egen capweight_return = wtmean(Return_lead1), weight(Market_Cap),
> by(Country, Period)
>
> But the stata says "unknown egen function wtmean()", does anyone knows
> how to fix that?
>
> Thanks.
>
> Best,
> Xixi Lin
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index