Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | owner-statalist@hsphsun2.harvard.edu |
To | statalist@hsphsun2.harvard.edu |
Subject | st: From: Jamie Madden <jamiem1234@gmail.com> |
Date | Wed, 22 Aug 2012 10:12:42 +0100 |
Hi, I am having difficultly understanding that I need to write float in front of numbers when I am creating new variables in order to compensate for precision issues. I have read "the penultimate guide to precision" by William Gould but it does not seem to answer my problem. For example if we look at (using Stata 12) sysuse auto, clear at the first row and column "gear_ratio", the value appears to be 3.58 when in reality when you click on it, it is 3.579999. I understand the reasoning behind this and understand if I want to create a variable for example that is greater than or equal to 3.58 I should type gen newvariable=1 if gear_ratio>=float(3.58) Surely there is no need to type float for every variable that you create in a dataset? Is there a way to set this up for your whole dataset? Or change the default setting? Thanks, Jamie * * 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/