Statalist


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

st: RE: data management updating a panel dataset


From   Howard Lempel <HLempel@brookings.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: data management updating a panel dataset
Date   Tue, 12 May 2009 18:37:58 -0400

Hi Massimiliano,

As Nick mentioned, your best bet is almost certainly to download the new year of data, -save- it as a Stata dataset, and then add it to your current dataset using the -append- command.  This would not require copying anything from Stata into Excel or -edit-ing any individual observations within Excel (which is what I understand you to mean in your first option).

Here is an example using a sample Stata dataset.  I first -save- the last year of data.  I then -drop- that data.  We will then have two datasets: one with all but the last year, and the other "updated" data with the last year.  From there, I -append- the new data onto the old data.

************ Begin example******************************

**** set up****
webuse nlswork
sum year // data goes from 1968 to 1988

*Create a dataset with just the last year
preserve
keep if year==88
tempfile y88
save `y88'
restore

drop if year==88
sum year // now my dataset is missing the last year of data

**** Set up over ****

append using `y88'
sum year // Now my data is updated
xtset idcode year

*********************************************************

If you don't feel like this example addresses your problem, we'll probably need some more information, including the format of the updated data.

Hope this helps.
Howie


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Volpi, Massimiliano
Sent: Tuesday, May 12, 2009 5:47 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: data management updating a panel dataset

Dear Statalisters,

I would like to update a panel dataset in Stata, for which a further year of observations has become available.
I would like to tell Stata to generate new observations and then edit them within Stata.
This would seem to me as a better option than listing the identifying variables, copying them as table, editing them in Excel and then appending the new to the old data base, which is the only alternative I see.
Any suggestion on how to do it? Or is there a reason for not doing so?
I am using Stata10.1

Many thanks

Massimiliano

-- 
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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