Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: why -if- does not work in -expandcl-?


From   Grace Jessie <gracejessie@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: why -if- does not work in -expandcl-?
Date   Tue, 18 May 2010 18:08:58 +0000

Dear statalists,
I found -if- did not work in the -expandcl-.
For example,
 

. clear
. input x y
             x          y
  1. 1 1
  2. 2 1
  3. end
. expandcl 2 if x==1,gen(new) cl(y)
(2 observations created)
. l
     +-------------+
     | x   y   new |
     |-------------|
  1. | 1   1     2 |
  2. | 1   1     1 |
  3. | 2   1     2 |
  4. | 2   1     1 |
     +-------------+

Why also expand when x equals 2?
Hope for any help.
 
Regards,
Grace 		 	   		  
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index