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]
st: replace values through observations with criterion
From
"Abssi, Fouad" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: replace values through observations with criterion
Date
Tue, 15 Oct 2013 23:12:40 +0000
I would like to copy a value of a variable in an observation and replace it to another observation in the same variable with criterion. I am using Stata 12.1 for Windows. I have 1754298 observations, and five variables: reporter, product, year, exporter, and tariff ON tariff data. My data looks like this.
Reporter Product Partner Year Tariff
GERMANY 111 Australia 1992 .
GERMANY 111 Australia 1993 4.36
GERMANY 111 Canada 1995 7.01
GERMANY 123 Canada 1992 0
GERMANY 123 Canada 1995 5
GERMANY 251 Chile 1993 2.81
UK 111 Australia 1992 3.2
UK 111 Australia 1993 3.75
UK 111 Canada 1995 7
UK 123 Canada 1992 5.94
UK 123 Canada 1995 5.48
UK 251 Chile 1993 4.29
USA 111 Australia 1992 0
USA 111 Australia 1993 4
USA 111 Canada 1995 5
USA 123 Canada 1992 2.73
USA 123 Canada 1995 3.62
USA 251 Chile 1993 4.39
I would like to tell Stata to copy tariff value from the observation where UK is Reporter (for example) to the observation where GERMANY is Reporter (for example), and (Product, year, and Partner are the same). Please note that the number of observations is 1754298, and for Reporter and Partner there are 50 countries, for Product there are almost 26 product, for Year there is 18 years.
Many Thanks,
Fouad Abssi
*
* 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/