I have one panel dataset, and I want to do the following:
To look up a value of index, let's call it "index" within my dataset based on two criteria, the countrycode does not equal to 3 and the year is equal to the year in the current row.
To illustrate, I exectued the code
Code:
separate china_penetration_ind, by(countrycode)
I wonder how can I do the following:
if countrycode==DE, replace china_penetration_indUK==china_penetration_indUK (for the values in those row whichcountrycode!=DE by matching year and nace), My dataset looks like the following. In summary, I want chinapeindDK to be in the same row with chinapeindDE by matching "nace" and "year"
Array
Thanks in advance
0 Response to How to combine two variables into one based on two criteria
Post a Comment