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

# Re: st: Time-splitting problem

 From Maarten buis To statalist@hsphsun2.harvard.edu Subject Re: st: Time-splitting problem Date Tue, 8 Feb 2011 11:17:09 +0000 (GMT)

```--- On Tue, 8/2/11, Morten Stover wrote:
> I'm doing an analysis where I want to split up the follow
> up-time in three parts. So my original model is like this:
> xi: xtmelogit up KJONN dev_lag1 year_92 year_92_kv, ||
> bosted:, covariance(independent) || year:,
> covariance(independent) or variance
>
> My time-variable is year_92 and goes from 0 to 15, and I
> guess the code (for the first part) should be
> if year_92==0 | year_92==1 | year_92==2 | year_92==3 |
> year_92==4 | year_92==5

I see three opportunities to write this shorter and easier
to read (there may be more):

if inlist(year_92, 0, 1, 2, 3, 4, 5)

if year_92 <= 5

if inrange(year_92, 0, 5)

> My problem is that I really don't know where to put it, and
> whatever I try, I get "option if not allowed r(198);"
> I am using Stata10

You put it before the || and the comma:

xtmelogit up KJONN ... if ...  || ... ,  ...

*-------------------- begin example ------------------
xtmelogit c_use urban age child* if age > -12 ///
|| district: urban, cov(unstruct)
*-------------------- end example --------------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

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/
```