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]

RE: st: programming error with -generate-


From   "Visintainer, Paul" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   RE: st: programming error with -generate-
Date   Mon, 8 Mar 2010 17:36:43 -0500

Check this out:  It looks as if this form, y=1.0x + c, is equivalent to 2^n 


. gen i = 1.0x +0
. tab i

          i |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |         10      100.00      100.00
------------+-----------------------------------
      Total |         10      100.00


. gen j = 1.0x +1
. tab j

          j |      Freq.     Percent        Cum.
------------+-----------------------------------
          2 |         10      100.00      100.00
------------+-----------------------------------
      Total |         10      100.00


. gen k = 1.0x +3
. tab k

          k |      Freq.     Percent        Cum.
------------+-----------------------------------
          8 |         10      100.00      100.00
------------+-----------------------------------
      Total |         10      100.00


. gen l = 1.0x +4
. tab l

          l |      Freq.     Percent        Cum.
------------+-----------------------------------
         16 |         10      100.00      100.00
------------+-----------------------------------
      Total |         10      100.00


. gen m = 1.0x +5
. tab m

          m |      Freq.     Percent        Cum.
------------+-----------------------------------
         32 |         10      100.00      100.00
------------+-----------------------------------
      Total |         10      100.00



___________________________________
Paul F. Visintainer, PhD
Baystate Medical Center
Springfield, MA 01199

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Monday, March 08, 2010 5:28 PM
To: [email protected]
Subject: RE: st: programming error with -generate-


<>

Does not even need an actual "x":


*******
clear
set obs 10
gen y = 1.2x+3
*******

It does, however, need an addition afterwards.

I guess Kieran`s guess re hexadecimal was right...

HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Lachenbruch,
Peter
Sent: Montag, 8. März 2010 23:15
To: '[email protected]'
Subject: RE: st: programming error with -generate-

But then it seems to take 12 and multiply by 6 to get 72.  This is the kind
of arithmetic my students sometimes do... :-)

Tony

Peter A. Lachenbruch
Department of Public Health
Oregon State University
Corvallis, OR 97330
Phone: 541-737-3832
FAX: 541-737-4001


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Richard Williams
Sent: Monday, March 08, 2010 1:51 PM
To: [email protected]; '[email protected]'
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:  [email protected]
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/


*
*   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/

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE: This email communication and any attachments may contain confidential and privileged information for the use of the designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its contents is prohibited. If you have received this communication in error, please reply to the sender immediately or by telephone at (413) 794-0000 and destroy all copies of this communication and any attachments. For further information regarding Baystate Health's privacy policy, please visit our Internet web site at http://www.baystatehealth.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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index