[Limdep Nlogit List] create puzzle

Philip A. Viton viton.1 at osu.edu
Mon Aug 3 02:11:07 EST 2009


Can anyone see what I'm doing wrong here - why t4 is different from 
t3? I've been staring at it for a while and just can't see it. Thanks!!

? t1 has a minimum of -11

--> create;t1=year-ayear$
--> dstats;rhs=t1$
Descriptive Statistics
All results based on nonmissing observations.
===============================================================================
Variable        Mean         Std.Dev.        Minimum         Maximum      Cases
===============================================================================
-------------------------------------------------------------------------------
All observations in current sample
-------------------------------------------------------------------------------
T1        11.0689455      8.06626950     -11.0000000      80.0000000      13808



? now create t3, which marks negative
? values of (year-ayear) ie t1, as missing.
? This works: t3 has min of 0
? and has fewer "good" observations


--> create;if(t1<0)t3=-999;(else) t3=t1$
--> dstats;rhs=t3$
Descriptive Statistics
All results based on nonmissing observations.
===============================================================================
Variable        Mean         Std.Dev.        Minimum         Maximum      Cases
===============================================================================
-------------------------------------------------------------------------------
All observations in current sample
-------------------------------------------------------------------------------
T3        11.1109498      8.03377008      .000000000      80.0000000      13772


? now try with t4, which has an explicit expression
? in the if statement. This fails: t4 looks like t1
? and has the same number of "good" observations



--> create;if((year-ayear)<0)t4=-999;(else) t4=t1$
--> dstats;rhs=t4$
Descriptive Statistics
All results based on nonmissing observations.
===============================================================================
Variable        Mean         Std.Dev.        Minimum         Maximum      Cases
===============================================================================
-------------------------------------------------------------------------------
All observations in current sample
-------------------------------------------------------------------------------
T4        11.0689455      8.06626950     -11.0000000      80.0000000      13808




------------------------
Philip A. Viton
City Planning, Ohio State University
275 West Woodruff Avenue, Columbus OH 43210
viton.1 at osu.edu



More information about the Limdep mailing list