Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: best practice for dates and times

From   Maarten buis <>
Subject   RE: st: best practice for dates and times
Date   Mon, 21 Feb 2011 18:44:54 +0000 (GMT)

---  Liao, Junlin
> Please note in previous code I had intentionally set type
> to float. -replace- still choose double for results of
> -clock-. Suppose I do another calculation, -replace- will
> choose float. Therefore, -replace- must know about -clock-.

--- On Mon, 21/2/11, Nick Cox wrote:
> As I understand it, -replace- looks at values, not what
> produced them. If it sees a particular number that should
> be stored as -double-, it is not because it comes tagged
> with a history "produced by -clock()-; act accordingly". 

Nick seems to be right, -replace- will increase the storage
type regarless of what function produced it, just not 
float, which I think is a sensible default given what was
said before.

set obs 1
gen byte foo = 1
replace foo = 10000

-- Maarten

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index