Hi all,
so I have 55 countries and I would like to perform some operations on each possible combination of them. Specifically, I would like to find the products in common among these countries. For sake of simplicity, since. the code for the latter part is long and tedious and I should be fine with that, I do not include it. If necessary, please let me know.
In any case, the idea is the following:
PART1: start with a country, say country1, append another country, say country2, and check if there are products in common and how many products are in common between the two. If the number of products in common is above a certain threshold t, then keep products in common of country1 and country2. With this new data, add country3, see if and how many products are in common between the three, and if this is above a certain threshold, then keep the data country1 country2 countr3 and so on. I don't know if it works but I was guessing something like:
but am stuck at the if condition.
Furthermore, if possible, I would like to do it for every possible combination of the 55 countries...which is quite a time consuming task I guess.
so I have 55 countries and I would like to perform some operations on each possible combination of them. Specifically, I would like to find the products in common among these countries. For sake of simplicity, since. the code for the latter part is long and tedious and I should be fine with that, I do not include it. If necessary, please let me know.
In any case, the idea is the following:
PART1: start with a country, say country1, append another country, say country2, and check if there are products in common and how many products are in common between the two. If the number of products in common is above a certain threshold t, then keep products in common of country1 and country2. With this new data, add country3, see if and how many products are in common between the three, and if this is above a certain threshold, then keep the data country1 country2 countr3 and so on. I don't know if it works but I was guessing something like:
Code:
local countries = "FRANCE" levelsof Country, local(paesi) foreach i in `paesi'{ local countries = `countries' + `i' foreach i in `countries'{ *perform code for checking if there are products in common; if tresshold> t{ *continue -->????? }
Furthermore, if possible, I would like to do it for every possible combination of the 55 countries...which is quite a time consuming task I guess.
Comment