Statalist The Stata Listserver


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

st: RE: Filling data


From   =3D?iso-8859-1?Q?Johan_Hellstr=3DF6m?=3D <[email protected]>
To   <[email protected]>
Subject   st: RE: Filling data
Date   Tue, 27 Mar 2007 10:57:33 +0200

I am not sure what you want to do? Do you have observations with some gaps
as in Gini2 and want to fill in the missing values as in Gini1? If this is
the case, you can start with creating a time variable that covers all the
years you are interested in, called for example 'year', thereafter type:

fillin country year
sort country year
gen gini1=3Dgini2
by country(year), sort: replace gini1=3D gini1[_n-1] if gini1>=3D .

Best,
Johan Hellstr=F6m



>-----Original Message-----
>From: [email protected]
>[mailto:[email protected]]On Behalf Of Javier
>Bacarreza
>Sent: Tuesday, 27 March 2007 1:58 PM
>To: Stata List
>Subject: st: Filling data
>
>
>Hello,
>
>I'm working with some data and Im having problems filling some missing dat=
a
>have data as follows, and want to fill the missing data as I did in the
>example below (gini2). Given that the time period between available
>observations is not regular its quite complicated to create the gini2
>variable.
>
>I would really appreciate if you could give me a hint.
>
>All the best!
>
>J
>
>
>countryyeargini1gini2
>Argentina196143.443.4
>Argentina196243.4
>Argentina196343.4
>Argentina196443.4
>Argentina196543.4
>Argentina196643.4
>Argentina196743.4
>Argentina196843.4
>Argentina196938.138.1
>Argentina197038.1
>Argentina197138.1
>Argentina197238.1
>Argentina197338.1
>Argentina197436.736.7
>Argentina197536.7
>Argentina197636.7
>Argentina197736.7
>Argentina197836.7
>Argentina197941.341.3
>Argentina198041.3
>Argentina198141.3
>Argentina198241.3
>Argentina198341.3
>Argentina198441.3


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