Statalist The Stata Listserver


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

Re: st: replace values of all members of a group with the values of one


From   "Sebastian F. Büchte" <sfbuechte@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: replace values of all members of a group with the values of one
Date   Tue, 23 May 2006 09:27:16 +0200

Tessa,

I need to add sth!
/* generating a variable holding the date from the appointment with
  def_inrange==1. This won't work for groups where def_inrange takes
  a missing value.

  Added: an if-condition to make sure that the command does not produce
              wrong results for groups with all def_inranges==0!

*/
bysort donor_id (def_inrange): gen test=date[_N] if def_inrange[_N]==1

Sebastian

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