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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Creating new variable from existing observations


From   Suryadipta Roy <sroy2138@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Creating new variable from existing observations
Date   Sat, 9 Jun 2012 13:47:45 -0400

Nick and fellow Statalisters,
Please forgive my inadvertent previous post. It went out by accident!
I followed up on Nick's advice on my original query and have obtained
mostly satisfactory results. I will work on whatever glitches remain.

I actually had another question relating to replacing missing
observations for panel data. My original dataset has been sorted by
exporter, importer, and year. I am trying the following to replace
missing observations for a variable for both importer and exporter by
a following value for one/more years:

by importer exporter (year), sort: replace myvar = myvar[_n+1] if myvar >= .

However, this only replaces the value for one previous year and leaves
the rest unchanged. Can anyone let me know how to fix this problem and
replace the missing value for all previous years for all exporters and
importers?

Once again, my most sincere apologies for the previous slip!

Best regards,
Suryadipta.
*
*   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   |   Site index