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]

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


From   jpitblado@stata.com (Jeff Pitblado, StataCorp LP)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: why -if- does not work in -expandcl-?
Date   Tue, 18 May 2010 14:21:34 -0500

Grace Jessie <gracejessie@hotmail.com> is using -expandcl- with an -if-
restriction, but the -if- restriction is not being properly applied:

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

Grace found a bug in -expandcl-.  We have determined the cause; the fix will
be available in the next ado-file update.

--Jeff
jpitblado@stata.com
*
*   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