Hi, I'm trying to get my head around how to best perform this operation. Here is a sample of my dataset:
I basically have a panel dataset per country, ID and year. I need to conform France's data to that of all the other observations -- this means that I need to condense those 3 observations into one, where cost = cost if threshold = cost, and LOS = LOS for threshold = LOS. Same for the number of observations.
I am having a hard time coming up with a formula that makes sense and doesn't erase data from other observations. The variable threshold exists only for France, but the others are shared across all observations.
Thanks in advance for your help!
Country | Cost | LOS | Threshold | N_cases cost | N_cases LOS | N_cases | ID | Year |
FRA | 500 | 5 | . | . | 8 | 1 | 2014 | |
FRA | 400 | 5 | Cost | 7 | . | . | 1 | 2014 |
FRA | 500 | 7 | LOS | . | 6 | . | 1 | 2014 |
GBR | 600 | 3 | . | 10 | 9 | . | A | 2014 |
IRE | 700 | 4 | . | 12 | 12 | . | B | 2014 |
ITA | 800 | 4 | . | 20 | 22 | . | C | 2014 |
ISR | 550 | 6 | . | 13 | 11 | . | D | 2014 |
I basically have a panel dataset per country, ID and year. I need to conform France's data to that of all the other observations -- this means that I need to condense those 3 observations into one, where cost = cost if threshold = cost, and LOS = LOS for threshold = LOS. Same for the number of observations.
I am having a hard time coming up with a formula that makes sense and doesn't erase data from other observations. The variable threshold exists only for France, but the others are shared across all observations.
Thanks in advance for your help!
Comment