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: generate rolling proportions with foreach using an MI dataset


From   Maarten Buis <[email protected]>
To   [email protected]
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 <[email protected]> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index