Statalist


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

Re: st: R: Patients missing visits


From   "Vladimir Vakhitov" <[email protected]>
To   [email protected]
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 <[email protected]>:
> 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 <[email protected]> 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: [email protected]
>  >  [mailto:[email protected]] Per conto di Ziad El-Khatib
>  >  Inviato: sabato 8 marzo 2008 6.21
>  >  A: [email protected]
>  >  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
[email protected]
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index