Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Combine sectional data files of different years into one panel data file
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Combine sectional data files of different years into one panel data file
Date
Tue, 4 Jun 2013 18:50:53 +0100
You said
"I tried the merge (1:1 using nohold and nomem together to uniquely
identify each individual), append, or a combination of those commands,
but could not succeed."
I think you need to show your code and/or explain what "could not
succeed" means. Otherwise the most predictable reply is just that your
code must have been incorrect, except that most list members would
just mutter that to themselves and not post.
If your example data were in files -nerissa2001-, -nerissa2002- this
should succeed
u nerissa2001
gen year = 2001
append using nerissa2002
replace year = 2002 if missing(year)
-- but better advice depends on better information from you.
Nick
[email protected]
On 4 June 2013 18:31, Nerissa Fanoembi <[email protected]> wrote:
> Thanks for your reply. But this is already done.
>
> ----------------------------------------> Date: Tue, 4 Jun 2013 18:28:04 +0100> Subject: Re: st: Combine sectional data files of different years into one panel data file> From: [email protected]> To: [email protected]>> This is a problem for -append-, not -merge-. But you will need to> ensure that the year is a variable within each data file first.>>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/