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: Time-splitting problem


From   Morten Støver <morten.stover@ntnu.no>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Time-splitting problem
Date   Tue, 08 Feb 2011 12:31:26 +0100

It worked. Thanks a lot!

Maarten buis wrote:
--- 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 ------------------ webuse bangladesh, clear
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/

--
Morten Støver
MA, PhD Student
Department of Public Health and General Practice
Faculty of Medicine Norwegian University of Science and Technology
Medisinsk teknisk forskningssenter
N-7489 Trondheim
Tel +47 73597525

*
*   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