Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

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


From   Grace Jessie <[email protected]>
To   <[email protected]>
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index