Hello. The graph is snipped from a large dataset. I want to change the variable named havePTA from 1 to 0 the year after one of the countries in the country pair withdraws the trade agreement, and I want to keep the havePTA equal to 1 after the same country pair signs another trade agreement. How can I achieve the goal? For example, in the graph, I want to change havePTA to 0 in the year 2008-2014. The example is easy to do. But the year withdrawal equals 1 for the whole dataset, which is not a fixed number. It is often the case that one of the countries in the country pair withdraws several agreements in several years. For the same reason, the year the country pair signs a new agreement again is not a fixed number, too.
Explanation of variables:
year: calendar year
ISO1: country name
ISO2: country name
number: Unique ID for each trade agreement in the dataset
withdrawl: dummy variable equals 1 if one of the countries of the country pair withdraws the agreement in the year
pair_id: country id
year_sign: the year when the country pair sign or withdraw a trade agreement
havePTA: dummy variable equals 1 if both of the countries of the country pair in a trade agreement
Explanation of variables:
year: calendar year
ISO1: country name
ISO2: country name
number: Unique ID for each trade agreement in the dataset
withdrawl: dummy variable equals 1 if one of the countries of the country pair withdraws the agreement in the year
pair_id: country id
year_sign: the year when the country pair sign or withdraw a trade agreement
havePTA: dummy variable equals 1 if both of the countries of the country pair in a trade agreement
Comment