Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: Classifying Subjects


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: Classifying Subjects
Date   Tue, 18 Oct 2005 18:40:53 +0100

I still recommend, although not 
impartially, seeing what -tsspell- 
can do for you. 

Nick 
n.j.cox@durham.ac.uk 

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of 
> Raphael Fraser
> Sent: 18 October 2005 18:28
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: RE: Classifying Subjects
> 
> 
> >Do you mean just consecutive tests?
> yes. Hence it is quiet possible that some subjects cannot be 
> classified.
> 
> 
> 
> On 10/18/05, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> > Your example indicates that gaps may exist in the data.
> > Subject 31 was not measured in various years e.g. 1987,
> > 1988. Thus if you want classification according to
> > consecutive years you need to specify how missing
> > [meaning, not present in the data] values are to be
> > treated. Do you mean just consecutive tests?
> >
> > In addition, it seems possible in principle that
> > an individual could be assigned to two or more
> > classes according to different parts of their history.
> >
> > So, I am not clear that writing specific code is
> > the best answer to you until these ambiguities are
> > resolved. But if you go
> >
> > . bysort id (dot) : gen t = _n
> > . tsset id t
> >
> > you can look for spells in your data according to
> > your stated criteria. The user-written
> > program -tsspell- from SSC can be then used. It has
> > a fairly detailed help file.
> >
> > Nick
> > n.j.cox@durham.ac.uk
> >
> > Raphael Fraser
> >
> > > I have a longitudinal data set that contains nearly 500 
> patients. All
> > > patients were tested at these times dot (date of test) 
> for the level
> > > of protein in the blood; the result being 0 (no protein) T (trace
> > > amounts of protein), 1, 2, 3 or 4. I would like to classify these
> > > subjects based on the criteria below:
> > >
> > > "Minimal" if protein is T on at least 2 out of 3 
> consecutive years.
> > > "Sustained" if the result is minimal and lasts 3 years or more.
> > > "Heavy" if sustained with protein  2 or greater lasting 3
> > > years or more.
> > >

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index