11.07.2015 Views

[U] User's Guide

[U] User's Guide

[U] User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

118 [ U ] 12 Data12.2 NumbersA number may contain a sign, an integer part, a decimal point, a fraction part, an e or E, and asigned integer exponent. Numbers may not contain commas; for example, the number 1,024 must betyped as 1024 (or 1024. or 1024.0). The following are examples of valid numbers:5-55.2.55.2e+25.2e-2Technical noteStata also allows numbers to be represented in a hexadecimal/binary format, defined as[+|-]0.0[〈zeros〉]{X|x}-3ffor [+|- ]1.〈hexdigit〉[〈hexdigits〉]{X|x}{+|-}〈hexdigit〉[〈hexdigits〉]The lead digit is always 0 or 1; it is 0 only when the number being expressed is zero. A maximum of13 digits to the right of the hexadecimal point are allowed. The power ranges from -3ff to +3ff. Thenumber is expressed in hexadecimal (base 16) digits; the number aX+b means a × 2 b . For instance,1.0X+3 is 2 3 or 8. 1.8X+3 is 12 because 1.8 16 is 1 + 8/16 = 1.5 in decimal and the number is thus1.5 × 2 3 = 1.5 × 8 = 12.Stata can also display numbers using this format; see [U] 12.5.1 Numeric formats. For example,. di 1.81x+26.015625. di %21x 6.015625+1.8100000000000X+002This hexadecimal format is of special interest to numerical analysts.12.2.1 Missing valuesA number may also take on the special value missing, denoted by a period (.). You specify amissing value anywhere that you may specify a number. Missing values differ from ordinary numbersin one respect: any arithmetic operation on a missing value yields a missing value.In fact, there are 27 missing values in Stata: ‘.’, the one just discussed, as well as .a, .b, . . . ,and .z, which are known as extended missing values. The missing value ‘.’ is known as the defaultor system missing value. In any case, some people use extended missing values to indicate whya certain value is unknown—the question was not asked, the person refused to answer, etc. Otherpeople have no use for extended missing values and just use ‘.’.Stata’s default or system missing value will be returned when you perform an arithmetic operationon missing values or when the arithmetic operation is not defined, such as division by zero, or thelogarithm of a nonpositive number.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!