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

st: RE: data management updating a panel dataset

From   Howard Lempel <>
To   "" <>
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
keep if year==88
tempfile y88
save `y88'

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.

-----Original Message-----
From: [] On Behalf Of Volpi, Massimiliano
Sent: Tuesday, May 12, 2009 5:47 PM
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


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:

*   For searches and help try:

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