Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: puzzling "missing" before and after "gen newvar = mdy(a, b, c)"


From   Michael McCulloch <[email protected]>
To   Statalist <[email protected]>
Subject   st: puzzling "missing" before and after "gen newvar = mdy(a, b, c)"
Date   Fri, 12 Jan 2007 13:35:45 -0800

Hello,
I've converted a string date (yyyymmdd) to Stata format, using:

. * convert datedx to Stata format
. tostring datedx, replace
        datedx was double now str8
. generate str4 dxyr1= substr(datedx,1,4)
. generate str2 dxmo1 = substr(datedx,5,6)
. generate str2 dxda1 = substr(datedx,7,8)
. destring dx*, replace
        dxyr1 has all characters numeric; replaced as int
        dxmo1 has all characters numeric; replaced as byte
        dxda1 has all characters numeric; replaced as byte
. gen datedx1 = mdy(dxmo1, dxda1, dxyr1)
        (387 missing values generated)
. format datedx1 %d

However, search for missing values before & after my commands yields nothing:
. list datedx if missing(datedx) in 1/10

Where might the missing 387 values have originated?




Best wishes,
Michael


____________________________________

Michael McCulloch
Pine Street Clinic
Pine Street Foundation
124 Pine Street, San Anselmo, CA 94960-2674
tel     415.407.1357
fax     415.485.1065
email:  [email protected]
web:    www.pinest.org
        www.pinestreetfoundation.org
        www.medepi.net/meta





*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index