Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: R: Patients missing visits


From   "Vladimir Vakhitov" <vvakhitov@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: R: Patients missing visits
Date   Sat, 8 Mar 2008 22:34:52 -0500

Ziad,

If your variables are visits, create a set of dummy variables which
are ones for each visit (with -foreach v of varlist- cycle) and add
them all up with -egen totvis=rowtotal()- function. The variable
totvis will be the number of visits.

Vladimir.


2008/3/8, Ziad El-Khatib <Ziad.El-Khatib@ki.se>:
> Hi again,
>  i could not manage to implement the code below in my dataset because i
>  don't know how many patients out of how many didn't come, any tips
>  about more generic code?
>
>
>  Thank you in advance and best regards
>  ziad
>
>
>
> On Sat, Mar 8, 2008 at 1:46 AM, Carlo Lazzaro <carlo.lazzaro@tin.it> wrote:
>
> > Dear Ziad,
>  >  please take a look at what follows below (assuming: 10 patients=id; one
>  >  visit=first_visit):
>  >  ------------------------------begin example---------------------------
>  >  set obs 10
>  >  obs was 0, now 10
>  >
>  >  . g id=_n
>  >
>  >  . g first_visit=1 in 1/5
>  >  (5 missing values generated)
>  >
>  >  . replace  first_visit=0 in 6/10
>  >  (5 real changes made)
>  >
>  >  . count  if  first_visit==0 & id!=.
>  >     5
>  >
>  >  . list  if  first_visit==0 & id!=.
>  >
>  >      +---------------+
>  >      | id   first_~t |
>  >      |---------------|
>  >   6. |  6          0 |
>  >   7. |  7          0 |
>  >   8. |  8          0 |
>  >   9. |  9          0 |
>  >   10. | 10          0 |
>  >      +---------------+
>  >  --------------------------------------end
>  >  example---------------------------HTH and Kind Regards,
>  >
>  >  Carlo
>  >
>  >  -----Messaggio originale-----
>  >  Da: owner-statalist@hsphsun2.harvard.edu
>  >  [mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di Ziad El-Khatib
>  >  Inviato: sabato 8 marzo 2008 6.21
>  >  A: statalist@hsphsun2.harvard.edu
>  >  Oggetto: st: Patients missing visits
>  >
>  >  Dear STATA lister,
>  >  I am following cohort of patients over different time points (variable
>  >  = visit). I am looking at couple of indicators, for example vl and
>  >  weight at every visit.
>  >  I want to find
>  >  1) the number of patients who didn't come to every visit?
>  >  2) and to find which patients didn't come?
>  >
>  >  Any tips how to do it?
>  >
>  >  Thank you in advance and best regards
>  >  ziad
>  >  *
>  >  *   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/
>  >
>  >
>  >  *
>  >  *   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/
>  >
>  *
>  *   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/
>


-- 
__________________
Volodymyr Vakhitov
vvakhitov@gmail.com
*
*   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