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: replace values through observations with criterion
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: replace values through observations with criterion
Date
Wed, 16 Oct 2013 00:28:03 +0100
You talk about a criterion, but you don't say what it is. If the
problem is just as you report, then you might as well just type in the
single value to be used in the Data Editor. You seem to be implying
that you want a general rule, but I can't follow what it is.
Nick
[email protected]
On 16 October 2013 00:12, Abssi, Fouad <[email protected]> wrote:
> 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/
*
* 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/