Statalist The Stata Listserver


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

st: RE: Replacing missing values


From   "Maarten Buis" <[email protected]>
To   <[email protected]>
Subject   st: RE: Replacing missing values
Date   Mon, 21 Aug 2006 17:13:26 +0200

assuming that the variable 1998 is actually called y1998:
replace y1998 = y1998[1] if y1998==.
HTH,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z434 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Ms. Marilyn Ibarra
Sent: maandag 21 augustus 2006 17:07
To: [email protected]
Subject: st: Replacing missing values

I have the following data:

Nace_ind        Industry     1998     1999  2000       
c_d_e           Total        3.2       4.3   1.2       
da12            Beverages    2.2       9.5   4.3       
da13            Tobacco       
da15            Textiles     2.1       4.9   6.5       
dj12            Wood
dc43            Electrical   8.5       3.3   9.1               
The first row are the variable names.  I would like to replace all missing values with the values of the first row (nace_ind=c_d_e and Industry=Total).  It would look like this:


Nace_ind        Industry     1998     1999  2000       
c_d_e           Total        3.2       4.3   1.2       
da12            Beverages    2.2       9.5   4.3       
da13            Tobacco      3.2       4.3   1.2
da15            Textiles     2.1       4.9   6.5       
dj12            Wood         3.2       4.3   1.2
dc43            Electrical   8.5       3.3   9.1

Thank you in advance,
Marilyn.





----------------------
Ms. Marilyn Ibarra
University of Georgia
Economics Department
503 Brooks Hall
706-340-2879
*
*   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/

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