Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Martin Weiss" <martin.weiss1@gmx.de> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | RE: st: programming error with -generate- |
Date | Mon, 8 Mar 2010 22:53:51 +0100 |
<> And it desperately needs the leading "1", otherwise this "functionality" is not available: ******* clear set obs 10 range x 1 10 gen y = 1.2x + 6 gen ynew = 1.3x + 6 gen ynew2 = 2.3x + 6 ******* -generate- is built-in, so it is difficult to look at what is really happening on the ground... HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Richard Williams Sent: Montag, 8. März 2010 22:51 To: statalist@hsphsun2.harvard.edu; 'statalist@hsphsun2.harvard.edu' Subject: Re: st: programming error with -generate- At 04:31 PM 3/8/2010, Visintainer, Paul wrote: >. gen y = 1.2x + 6 <----- why isn't there an error here? When I do this, y = 72 for all cases. So 1.2x must be getting interpreted as 1.2 * 10 = 12. I don't know why, but just follow Martin's advice and make it gen y = 1.2*x + 6 Maybe this is a "feature" but if so it doesn't seem like a good one, since this could be an easy mistake to make. ------------------------------------------- Richard Williams, Notre Dame Dept of Sociology OFFICE: (574)631-6668, (574)631-6463 HOME: (574)289-5227 EMAIL: Richard.A.Williams.5@ND.Edu WWW: http://www.nd.edu/~rwilliam * * 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/ * * 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/