Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: Database problem


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Database problem
Date   Sat, 8 Dec 2012 00:20:33 +0000

My experience is contrary to both your inclinations.

1. -reshape long- will make it easier to sort out date order, so you
need not worry about dates beforehand. (Besides when you say "merge",
you presumably don't mean -merge-, but something else.)

2. I see no loop being needed  here. As before, I envisage -rename-
and -reshape-.

Nick

On Fri, Dec 7, 2012 at 7:36 PM, roland andersson <rolandersson@gmail.com> wrote:

> I will do that, but before changing to the long stucture I think it
> could be easier to merge the observation with the same date. This
> means that if to datecolumns are equal I would like to merge the
> corresponding content columns. How can I write a loop that compares
> every var9 var12; var12 and var15 and if equal merge var8 and var11
> and so on.
*
*   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/


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