I have a question regarding creating a new variable depending on many other variables.
My dataset looks like this: (You see, there are different products depending on the country, and different sales. Some products are not (yet) on the market (sales=0)).
Country | Product | Sales 1/2003 | Sales 2/2003 | Sales 3/2003 | Sales 4/2003 | Sales 1/2004 | Sales 2/2004 | Sales 3/2004 | Sales 4/2004 |
Germany | Product A | 0 | 0 | 0 | 0 | 0 | 3 | 5 | 7 |
Germany | Product B | 0 | 3 | 4 | 0 | 0 | 7 | 8 | 9 |
Germany | Product C | 12 | 12 | 12 | 14 | 15 | 17 | 18 | 17 |
Germany | Product D | 2 | 5 | 7 | 0 | 0 | 10 | 8 | 7 |
UK | Product A | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 |
UK | Product B | 0 | 0 | 0 | 2 | 3 | 4 | 5 | 6 |
UK | Product D | 1 | 1 | 1 | 1 | 1 | 2 | 2 | 2 |
France | Product A | 3 | 4 | 5 | 6 | 6 | 6 | 6 | 7 |
France | Product C | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 |
France | Product D | 12 | 13 | 19 | 19 | 34 | 0 | 0 | 0 |
Spain | Product A | 1 | 2 | 3 | 4 | 0 | 0 | 7 | 8 |
Spain | Product B | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 3 |
Spain | Product C | 3 | 4 | 5 | 6 | 7 | 7 | 6 | 0 |
Spain | Product D | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 3 |
Many thanks for your answers!
Best, Milena
0 Response to Create variable depending on many variables
Post a Comment