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, statalist.org is already up and running.


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

Re: st: generate rolling proportions with foreach using an MI dataset


From   Maarten Buis <maartenlbuis@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: generate rolling proportions with foreach using an MI dataset
Date   Wed, 2 Nov 2011 14:26:36 +0100

On Wed, Nov 2, 2011 at 2:18 PM, Tim Evans <Tim.Evans@wmciu.nhs.uk> wrote:
> I am trying to obtain proportions of a variable over time using an MI dataset in Stata 11.2, this I achieve using:
>
>
> mim: proportion stage if _mj>0, over(year)
>
> However, each single year does not contain as many cases as I would like, so I would like to combine 5 years of data for eahc data point

gen year5 = floor(year/5)*5
mim: proportion stage , over(year5)

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany


http://www.maartenbuis.nl
--------------------------
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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